[WIP] Add serializer interface

Targets #161.
I'll re-add this comment here: Shouldn't we use a fixed-size type, like `uint32_t`? Plugins would be much more portable this way!