Improve efficiency of query funcs
Improve efficiency of query funcs

Cache computations in the merge array, and use binary search to perform
the index lookup. This is the first step of converting `cdf` and
`quantile` to ufuncs.

jcrist/crick,jcrist/crick