Added dump to csv file for d3 plotting
Dir tidy up