Laid down framework for serialization.

Essentially all that's left is a pretty interface; the heavy-lifting
code is done.