Use the six library for compatability

Replace dict.iteritems() with six.iteritems(dict)
Import six for StringIO
Import urlutils for urlencode

Partial implement: blueprint py33-support

Change-Id: Ieae1299915168ef10ff54e0a9e9a346350e9d1fb