Add support for nested objects (fixes #20)