Use explicit imports; make compatible with Python 3