Upload file, clean the file, output to Downloads (like one of the bokeh examples)

I do not think the js code Object.keys(source.data) does any sorting. You can test out on MDN.

But I guess result.to_csv('test_file.csv', index = None, header=True) gives the correct format?

Other than this I do not have any good suggestions.