Python3 fixes (relative imports, inconsistent use of tabs and spaces, urllib2)