More clean up and tests.
JSHint cleanup.