Python 3 support (not yet fully tested)