Fixed str encoding for python2/3 compatibility, fixed relative imports, removed unnecessary urllib2 specification