[C] Ensure all fields are encoded big endian.
[C] Add basic compressed encoding
[C] Make encoding and decoding return codes more consistent.