Remove some unnecessary regular expressions from the templates util ns.

Also:

* Add tests for string-munging fns
* Correct doc for name-to-path
Merge pull request #939 from timmc/back-to-one-problem

Remove some unnecessary regular expressions from the templates util ns.