previously a.and(b).and(c) would produce this sql:
(a and (b and (c)))
which is valid (if ugly), but crashes sqlite's parser when too large.
we now produce:
(a and b and c)
similar for 'or'