Check code style in tests

This pull request would add code style testing using `flake8`.  This would ensure PEP8 compliance and add a ceiling to maximum code complexity per function.  We can ignore PEP8 rules that we don't agree with if we notice any that are annoying to obey.

I'm not yet sure whether I think we should do this on Travis also.

Thoughts on testing code style using flake8?