Changed pages.js to coffeescript