Added csv output option similar to the existing JSON output option. Requires an output filename.