Simplify restriction context using dlist monoid.
Simplify query builder by using writer instead of state.
Update haddock.