Moved all javascript into main.js