update nested resources and add qunit tests. Fixes #17. Fixes #16.