Move the record_*_data() helpers to Task methods.

Turned out to be needed for #802.