fixed to follow PEP8 coding style
fixed to pass some invalid doctests
added tox.ini to test for pep8/doctest with pytest