Refactoring - clean mustache templating.

Original goal was to integrate templating as scripting plugin. Turns out it's
easier to integrate this functionality as a custom query.