Use the Task::write*() helpers.

Along the #801 / #802 road.  Took too long because there was a nasty little bug with an inferred template param.