Python 3 compatibility

Perhaps you're interested in this, perhaps not.  It is just a quick Python 2+3 compatibility commit, simply the stuff I noticed when importing it in to my default 3.3 environment.

Note that it changes many Unicode literals to simple strings, which shouldn't introduce backwards compatibility problems unless downstream users are doing lots of naïve `isinstance` tests.

This remains compatible with Python 2.6 and above, and if Python 2.5 support is desired it would only require a little reworking of the exception handling.

Thanks,

James