Add Application.js and some code refactoring
Some minor UI improvements