PEP8 the codebase and add a test suite
PEP8 is a widely used and accepted Python style. This commit fixes any
PEP8 violations and adds a unit test that automatically lints new code
for PEP8.
There were several places where variables were being used that did not
exist. In those cases I took a guess at what was intended.
Signed-off-by: Jeremy Cline <jeremy@jcline.org>