Serialization similar to bencode from the BitTorrent project
