Use Text::CSV for output

Much easier to use this module than to try and remember correct
encodings, quotations etc.