Clean up app.js code to pass JSLint standards

In this PR
  - Lots of minor style changes to the JS code to make it readable.