Minor cleanup

Fixed some names, removed a lot of mis-inserted whitespace
Minor code cleanups

Fix jshint warnings, remove EOL whitespace,
fix some variable naming