Rewrite templates as objects
Merge pull request #176 from mmun/template-objects

Rewrite templates as objects