Support .tar.xz packages for pip install.

Hi, it seems my last pull request got somehow botched by git rebase. Anyhow, here is an updated patch, complete with tests and all discussed changes from the last one.