Dan f/cohort csv upload better memory

@dan-f Should include some tests with buffer_size > 1.