Fix flake8 errors
Add McCabe complexity checking to lint.sh

See https://pypi.python.org/pypi/flake8 for more details.  Hopefully,
this will be useful and not annoying.