Address review comments:
- extract methods for TaskInvalidationCriterion.passes, Task.bugzilla_bug and Task.invalidation_criteria
- rewrite tests for invalidate_tasks to use real objects instead of mocks
- add unit tests for all new methods