use isinstance test for basestring instead of the types module
use chain.from_iterable from itertools instead of snakeoil compat method

We've dropped support for versions previous to python 2.6 so we
shouldn't need the compat methods anymore.