Add tox for testing all Python versions

A compatibility module is added to help with Python 3.2/PyPy3 compatibility.