Implement filter context

closes #2559
- Added a new unit test for context based filters
- Accept new parameter `context` in doFilter
Merge pull request #2560 from halfdan/filter-context

Implement filter context