More object to generic changes.
Added serialization/deserialization.