Mostly pep8 cleanups in prep for rewriting of the SQL API.