Factorize CSV generation from aggregated results.
Split experimental code and helpers.