Remove some unfortunate consequences of migrating from CoffeeScript to JS (31ad9566), and some more.
For easier reviewing I recommend looking at each commit separately.