Add Python 3 support

Removed unused imports, including one for urlparse that has been renamed in Python 3