Templates

Complete overhaul of UI logic introducing templating. Consolidation of Util classes into util.js.