python3 compatibility

Hi, I needed this to run on Python3.4. Most of the changes are automatic 2to3 but some needed to be hand tuned (see bucket.py)