Replace basestring with str for python 3 compatibility.

Python 3 portability fix, makes at least send() on 3.3. AFAICT this doesn't break anything for the previous version, but my python2 is rusty so feel free to correct me if needed.