Python 3 support

I've ported this to python 3. Tested using nosetests as README suggested, and passed all tests for both python 2 and 3.

We probably want to keep the unicoding properties of this in Python 2.

http://stackoverflow.com/a/6812069