Get Flake8 looking clean

This addresses both pyflakes and pep8. See commit messages for more detail. In fixing this, this fixes #1.