kdtree: Add benchmarking.
kdtree: Combine truncation and interleaving for coeffs.

Makes pre-match initialization ~2-4% faster.
gck: Remove truncation and interleaving functions.

A combined version has since been moved to kdtree.
select: Add a pointer-based quickselect.

Much faster swapping -- just two pointers rather than whole
memory blocks -- at the expense of cache locality.

But faster overall.
kdtree: Remove unused functions.
kdtree: Use new quickselect.

~9-18% faster kdtree init. Also simplifies code greatly.
kdtree: Calculate x,y coords for target in source.

This avoids relying on the xy node field which has proven to be
problematic. For example, in case of identical tuples, if they
are in different nodes (say, one is a an inner node and another
is a leaf), then only the inner node will get assigned a xy value
during the get_positions phase. If the leaf gets selected during
matching, it has an invalid xy coord, and BAM! segfault.

So instead, since the coeffs are stored in the original order
with the new quickselect (only pointers into the coeffs are
permuted), we can calculate the index of the tuple by finding its
offset from the beginning of the array, and the x/y from there.

This guarantees that every tuple will have an x/y coordinate.

Also un-macroify some stuff that was done in the process of
debugging this, which I'm too lazy to put back together. Probably
best that way, anyway.
kdtree: Set coeff map during tree-building.

This is a substantial speedup over the old method of
querying all nodes for each tuple in a second pass.

Also simplifies the code which is a win in itself.