Add support for serialization.
No deserialization yet.