Write the initial builtin Template macro functions implementation.
Refactor builtin functions into a TemplateBuiltins class.

Also write some poor tests.