Refactored Task and SubTask, and implemented their tests.