[WIP] Add serializer interface

Targets #161.
Shouldn't we use fixed-size elements here? I would like to suggest `uint32_t`.