Some refactoring and generalizing

Created interface PointTree.
Put NNResult into its own file.
Made KDTree implement PointTree and did some restructuring.