Fixed javascript recursive algorithm for finding closest points, and also have perf comparisons