Added application.js

Processes events.