Add .gitignore.
Fix indentation.
Update to work with Python3.