Support unsorted data by switching to linear scan for closest point.

Going forward, probably will have an option to set a different algorithm.