Created by: camdencheek
This commit takes a stab at reducing commit/diff query trees during construction.
In response to Rijnard's comment
NewAnd, NewOr, NewNot, and NewOperator
And() to &Constant{true} and Or() to &Constant{false}
And(x) and Or(x) to x
And(And(x), y) to And(x, y) and Or(x, Or(y)) to Or(x, y)
Not(Not(x)) to x
This does some basic minimization during query construction to keep from generating deeply nested trees, but does not do any additional optimization passes. Those will be coming in a followup PR as a separate step.