Move prepare_task() into TaskTest.

Make all the tests that used it as a standalone method be
subclass TaskTest.

All tests pass after this change.
Address code review comments.
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP