Some patches to allow packaging with $PYTHON and $DESTDIR

Also fixed some portability issues with install(1) and compability issues with python2.6.