Convert history.js to coffeescript