WIP: refactor pypi2nix, add tests