Start work on #227; add support for serialization