Supporting both Python 2 and Python 3 with six

As we know python3 will not support built-in basestring, so we
should use 'six' to support both python2 and python3.

Change-Id: I9bad381f175602322cb750d6c1b62beeee222cb2
Partial-Bug: #1249886
Merge "Supporting both Python 2 and Python 3 with six"