Various applications of util.template

This is the first bunch for #1276. I'd like to resolve #1281 before doing more.
Merge pull request #1284 from Frenzie/language

Various applications of util.template