Added Templating

Added a TemplateRender class to the main dialogs. It uses the underscore
template function to generate templates. I never liked the inline HTML,
now all the large chunks of HTML (for the dialogs) are in template
files.

Rather than use the ugly <% %> that is default with Underscore, I've
used the template settings to change it to the more pretty {{ }}.