Divide application and common javascript

@phamann @ironsidevsquincy @commuterjoy