Python3

Fixes a number of Python 3 incompatiblities (resolves #51 ). This patch tests against py26, py27, py33, and py34. All tests are currently passing on tox. 
I'd prefer if we named this module `compat.py` - drop the leading underscore.