CMS-2192 Templates API design.
Refactored and simplified Controller.