Whitespace changes etc

Mostly whitespace changes.

I have changed a couple of comparisons to be more stricter (and hopefully more faster).

Will run this through jsHint and send another pull request for the changes.