New serialization system.

Right now the serialize method has to be created for every model by
hand. With the new system the serialization for most of the models can
be described declaratively. When needed, the serialize method can be
written by hand (useful for models that require a unusual
serialization).