Template tests

Tests for all template functions in a framework that should make it easier to write more in the future.
Added missing template functions to templates.md.
Looks like we still need the `{{end}}` tag