First steps towards serializing.
Serialization done and tested.