Csv fix

Backend changes to handle different extensions, also changed javascript to add mimeType to output based on the delimiter type.