Code linting and added runtests.py
Add flake8 to requirements
Resolve linting issues
Resolve python3 linting issue
Merge pull request #1780 from tomchristie/pytest-tweaks

Added `runtests.py` and `flake8` code linting.