Run doctest and pep8 in test suite.

Enhanced PEP8 compliance throughout code base.