Slight modifications to allow running on python 3

It'd be nice if the project could support python 2 and 3 from the beginning :)

I've been trying this with graphite-api and got it working just fine, only made these changes as I found python3 incompatibilities. Everything should still work on Python 2.

Ideally these `print`s should be replaced with proper logging calls or `sys.stdout.write`…