Lint the main js file

#### What is this thing
This pull request makes a start on implementing some boilerplate [JS CS](https://www.npmjs.org/package/jscs) style changes. This is pretty much entirely limited to basic stuff like:
- Single quotes not double quotes
- bundling variable declarations (generally, though I've left a few inline declarations in where it makes sense to without doing a more major refactor)
- braces around logic
- spaces around string concatenation
- (some) indentation matching
- remove trailing whitespece

#### Motivations and notes on what might seem like a ridiculously whiney pull request
- I realise this is absolutely loads to take in in a single pull request, but it should offer up some help to outside contributors like me who want to add in new features, but have linters screaming away at them as they plough through.
- The functionality should remain exactly the same, this is just style stuff.
- This may seem utterly absurd to you when you read this, so feel free to totally ignore it, and instead spend time looking at this really refined dog imitating [Carl Sagan](http://en.wikipedia.org/wiki/Carl_Sagan)

![](http://37.media.tumblr.com/tumblr_m6u0nmNdvm1qjn0zqo1_500.png 'Or was Carl Sagan imitating me?')