various pep8 cleanup, typo fixes, etc

Also, we are pretty inconsistent with the use of `# -- constants ---`. I would vote that it isn't really necessary and we can remove that too.