Changed the principle JS file to app.js
Some code fixes to deal with TS 0.9.1 compiler changes.
Some additional fixes to ensure correct value of "this".