Added some simple tests.
Metaprogrammed implementation of creating Model in Resource.