Add Python packaging

See inline notes of commits for details.
Also added a virtualenv-safe gitignore.