refactored to have objects be stdclass and arrays will be arrays
add support for handling a single object as a property