Removing unused code and enforcing additional JSHint options

This PR consists of three commits.

- The first commit removes unused code (and fixes small code style issues).
- The second commit enforces JSHint's `undef` option and makes the necessary changes to make lint succeed.
- The third commit enforces JSHint's `noarg` and `nonbsp` options. No code changes were necessary for this, but it's good to enforce them to avoid having them appear in the codebase in the future.