More work on relational filtering.

I am tracking this with #292