pep8 cleanups
pyflakes fixes
fix a couple API links in docs