pep8 fixes, including a declaration in tox.ini for running flake8

Change-Id: I2adc6a5cbd76edd16e6079046b67b8fc10bf1671