Change binary format for easier processing; add basic encoder/decoder tests for text and binary