flake8 style conventions fixes

If you are interested in a subset of these changes - let me know and I'll be happy to make an appropriate commit/pull request.

I used:
$ flake8 --max-line-length=100 --max-complexity=10