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.