Filter shouldmap enhancement

The first commit (Filter.appliesTo) was submitted as a separate pull request; but because the second commit can't be merged independently of the first with breaking things, this pull request is for both.