Simplification (using String.replace())

@hackygolucky,

I'm not sure if you're interested, but this pull request simplifies templatingLanguage by using [String.replace](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/replace), which can take a regular expression and a callback function that is called multiple times, once for each match (I didn't discover this until recently). The callback function takes the match as the first parameter and the capture groups as the other parameters.

I started working on a [similar templating language](https://github.com/prust/glass-templates) a couple weeks ago, but haven't gotten around to finishing it.