Create app.js

This is my current js-code. Needs some documentation and is awkwardly flawed in several ways.