Add K-D Tree based on Simon D. Levy's code, found at
http://home.wlu.edu/~levys/software/kd/