adding tests for nested objects

Opening this PR again for the new tests. Needs corresponding resource from the halbuilder-test-resources project.