Let's no block this PR for this but what about adding 3 todos to:
  - rename it to something more generic and more feature relevant (templateHelper, tmplHelper, tmplGenerator or anything better)
  - move this to js/ folder
  - put this utility under a dedicated namespace (eg no window._ctl)
  - quick comment code to give an example & high level explanation