Reverting change to .jshintrc by @jrolfs.
Refactoring and cleanup.
Indentation fixes and general cleanup after merge. Passes tests (only for commit so far).