- added sorting to kdtree data

could still be optimized with a partial sort, but the library
doesn't offer any partial sort yet.