More changes to comply with PEP8.
Docstring changes to comply with PEP257.
Ran over the module with PyLint.

Fixed more PEP8 problems, and other issues.
Fixed some problems that were causing tests to error.
Add methods for context manager support.