Fix doctest, remove outdated failing test
Cleanup: PEP8, Pyflakes, removing commented out code