Improve simplification of filters

This in total is about a 30-40% reduction in the speed of the for-vector test case, and should be faster than before the large jump.
I think this case can be combined with the `(? Struct?)` case above.