Serialization primitives that work with both cereal and binary.