Add invalidation filtering.

Almost exclusively new code. The unit test code churn is just moving
create_endpoint from test_impact to utils because it's now used in
multiple test modules.

Fixes ZEN-11104.