Naively writing out data on piece completion.

Hope to cache this and make it asynchronous soon.