Mostly non-functional cleanup for PEP8, typos, add missing doc, etc.

Also update setup.py so that it is an executable, and that
`./setup.py test` runs unittests.