Fix most flake8 issues (fixes #205)
Use dev version of pytest.

This should fix some issues with testing under py32, see
https://bitbucket.org/hpk42/pytest/issue/274/internalerror-when-running-doctest