Refactoring and template instance implementation

Refactored some tests and test helpers. Also implemented TemplateInstance.
As a bonus, I now know what kind of magic text/template has to do to call
```interface{}``` as a function with a variable amount of arguments.