You can now create documents with nested attributes

Closes #11 

@AlexeyMK The code for this is kind of convoluted. Can you think of a better way?