fix CSV regression for ruby 1.9.3; add tests for CSV generation and download