Add python gitignore
Various refactoring