Encoding csv from cases, to serve on download

Data download button calls a function that converts each model to a flat array, then prompts the browser to download the whole thing as a CSV.