Convert str, basestring and unicode to use six