Made json to csv converter more memory efficient

Don't store all the json in memory, write as we read.