Use string_types instead of str in isinstance.

Ready for review/merge.
Because it seems rather weird to have something in ext depend on vispy. Now that we're on the subject, can something be considered ext if we have modified the code?