Logical filter touch-ups

This corrects the behavior of the logical OR filter, adds logical NOT, and provides factories for all logical filters.