Changes and adaptations for getting a working version in Python 2 and Python 3

General changes.
New dependency: future