Code cleanup

PEP8 formatted the .py files and added a sensible .gitignore file.