pylint and pep8 changes, and docstrings added to modules, tests and example scripts