fix broken unittests discovered by Travis migration
pep8 fixes
fix pyflakes warnings
Merge pull request #1 from markmcclain/test_fixes

fix broken unittests discovered by Travis migration