Separates the main.js to core.js and popup.js
Migrates to CoffeeScript