generalise support for unicode in csv wrapper: type checking against basestring, and introduce codecs library to handle file opens