Added a controller.js, and made the code more modular. HUGE improvement.