make everything Pypi-compatible, fix some old code