Python library setup changes

Revised pull request, now tested on multiple platforms.