Add Task::get/set_regs() helpers and remove old interface.

#801.  Semantics-preserving refactoring.