add flake8 test for code formatting

Violations were fixed using autopep8 with some minor manual changes.
turn on debugging for testing