Clean up main.js.
Fix jshint warnings.
Lots of startup improvements.
Merge pull request #463 from NICTA/mainCleanup

Initialization cleanup
Merge remote-tracking branch 'origin/master' into newBroadbandServer