Fix pep8 issues and test configuration

Get the tests running and clean up simple style issues.