Update app.js

I've updated this file based on principals described in this article:

http://www.technofattie.com/2014/03/21/five-guidelines-for-avoiding-scope-soup-in-angular.html