[WIP] Add serializer interface

Targets #161.