Changed extract to use fputcsv (for correcting escaping/quoting)