Refactor and slim down app.js.
Updating build script.