Python3

Fixes a number of Python 3 incompatiblities. This patch tests against py26, py27, py33, and py34. All tests are currently passing on tox.