Fixed serialization issue

Nested objects in containers were generating invalid JSON
Classes/Structs are now always serialized as objects