Boatload of pylint and pep8 fixes