python3: Add basic compatibility support.

Add python2/python3 compatibility support:

- Change basestring to use six.string_type so that
six will either use str() or basestring().
- Use six.iteritems to replace dictionary.iteritems() on
python2 or dictionary.items() on python3.

Change-Id: I3a8eb1ba5b2fb2859169299d37ae6eeb9bb4cac0
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "python3: Add basic compatibility support."