Converted mostly to CoffeeScript.