Changing functions to prototype in app.js