Move record-event helpers to Task.

#802