Support for nested objects

Closes #1