Add backwards compatibility for unicode/basestring/str instance checking