Added a test that demonstrates #16.

Fixed #16.

Fixed import error.

Nested resources are now serielized correctly.

Fixed a test failure that was caused by the model change.