PEP8/Pylint/Pyflakes cleanup, and removing use of METRICS dictionary