Refactoring

encapsulate JS
not tested ^_^
fixed stupid mistake
Refactoring

moved js files back to static directory to avoid reconfiguration
fixed yet another stupid mistake