Python3 fixes.

Eliminated implicit relative imports, and priority() integers are cast
to strings for TypeError.