A kd-tree is a data structure for storing points in a Euclidean space. It is not optimised for data that changes (insertions/deletions) but is very efficient at spatial queries such as nearest-neighbour search. See http://en.wikipedia.org/wiki/Kd_tree
KDTree is initialised using an array of points - each of these points must be an array, each of the same size. If you want to store an item or label along with each point, you can add it as the last item of each point array, and set the lastIsLabel constructor argument to true (see examples below). The things that you can store as "labels" can be anything at all, but they should be things that can meaningfully be compared for equality. Numbers, symbols, strings, etc, are all fine.
(Note: You typically create a KDTree using an Array of points, but the array and the ordering of elements is not stored. The asArray method will return an array of points stored in the tree but typically in a different order.)
Create a new KDTree from an array of data. See example code below.
For speed tests see KDTree_benchmarking.
For unit tests (for correctness) there is a Unit Test class TestKDTree - basically just run KDTree.test