kdtree: backport gonum kdtree fixups
kdtree: backport gonum kdtree fixups

This retains the current API, but adds improvements that were found in
developing the kdtree implementation for Gonum.

biogo/store