Performance improvements
A closure is used to initialize the render function, to avoid recompilation of the regular expression used to match variable substitutions on every rendering cycle.
A closure is used to initialize the render function, to avoid recompilation of the regular expression used to match variable substitutions on every rendering cycle.