Created a streaming csv generator and re-enabled the csv generation code using this new approach