change code to work in python2.6 env and with fabric; update tests