PEP-8, code base cleanup, bug fixes

I'm still working through the code to make it `pep8` / `pylint` compliant, but it's already a lot of code to be reviewed at once... Good luck and sorry, @jdkasten! :)