Move to absolute import for Python 3 support.
Make basestring work in Python 3
Make urlencode load properly in python 3.