Mostly pass flake8.

This commit makes most of the code pass flake8. I did skip some of the 80
char line violations but those were ones I didn't want to touch yet.