Use assertIsInstance() instead of assertTrue(isinstance()).
Compare results with basestring on Python 2 (Fixes #27).
Fix PEP 8 issues.