Add basestring shim for Python 3