update/restructure query helpers, add ordering, distinct-result-set fns