Add support for serialization / deserialization.