Clean up of serializer generator.

See #183.
See #181.