Changed javascript to coffeescript

Map function should still work.