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.
Merge pull request #1 from niyazpk/patch-1

Whitespace changes etc from Niyaz. Thanks Niyaz...