reformatted for pep8 compliance, pyflakes, added .gitignore

pep8 compliant ...except for E501 (max line length) and E128 (line continuation)

no functional changes