first review of ngui

First review of ngui.

- Standardizes use of https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml wherever possible with comments, spacing, naming conventions etc.
- Changes .tpl files to .html and corresponding build targets.
- Contains a bunch of TODOs, this PR should only be merged once there are no [TODO]s remaining in these files.