WIP - still working on getting the template repository and models working correctly and adding some more tests.