Convert code from CoffeeScript to JS

I'm opening this PR for discussion/review of the CoffeeScript -> JS conversion.

So far I've gone over each file and tidied up the code, removing unnecessary "mess" that CoffeeScript generated, and where appropriate used native functions/lo-dash. (Note: lo-dash use is actually limited, so there could be an argument for removing it altogether).

There's probably a lot more tidying that can be done, but for now it's a good base for further development.

Tests all pass (which have also been converted to JS), and manual testing also passes.

Over to you for your thoughts @makeusabrew.
Just a general note across this and a few files; is strict equality checking not hip anymore? CS would naturally compile this with === checks rather than coerce the types. Any particular reason (purely out of interest!) that's generally avoided in the PR?