wrap top-level OR comment
Refactor

* In where SQL builder, replace recursion with `foldr`. Thanks Haskell.
* Rename `mode` to `side` everywhere.