Implement filter context

closes #2559
- Added a new unit test for context based filters
- Accept new parameter `context` in doFilter