Make writes through a pipeline to reduce waiting times

Just try to load some json with and without this patch applied (and measure the time needed for the operation) ;-)

Something analogous should be doable for dumping too (the gain in speed should be, in relative terms, even larger).