Refactors tests to use NewAppContext test helper method.
Implements tests for add task handler.