Task model, refactorings

- Refactored task properties and methods into a model object.
- Updated unit tests.