javascript file modified to MVC

JS files refactored to MVC OO