Port package to Python 3