added support for recursive toJSON method on object for retreiving child objects