pep8/pylint fixes: universal 4 space indents, spaces around operators, global stmt only when globals are written to, try to limit line length to 80.

Some minor simplifications.