Add command line option to generate csv files. Still WIP.