Split defquery into query and defquery. Introduce the wrap-query function