Resurrect native “str” type in Python 2

Use “basestring” for type checking instead.
Wrap “struct” and “array” format strings in native str() type

In Python 2, Unicode is not accepted for format strings, but it is preferred
Python 3.

Previously, the code was calling bytes() incorrectly, resulting in:

    TypeError: string argument without an encoding

Also, Python 3 does not accept a byte string for “array”, resulting in:

    TypeError: must be a unicode character, not bytes