Add serialization for Class and Enum values.