Refactor the mvc classes into separate JavaScript files