Many functions changed from JavaScript to CoffeeScript