Divide application and common javascript

@phamann @ironsidevsquincy @commuterjoy 

Most of it is path fixups....