Minor pylint/style fixes.

This is my first contribution to the project. I was reading some code to familiarize myself more with the codebase before tackling any actual tickets and did a little cleanup.

----

Updates changed files from a combined 4.39/10.0 pylint score
to 6.56/10.0.

* Fixes usage of Python builtins as variable names.
* Removes unused variables.
* Removes unused imports.
* Adds some docstrings.
* Fixes old-style exception handling.
* Adds missing `with` statement to json file handling.
* Replaces old-style class declaration.