Ported map.js to coffeescript.