First attempt at porting to Python 3.
Added fix that works in Python 2... but not Python 3.
Added .travis.yml.