Replace basestring with string_types (mostly), refs #38.