Fixed clustering logic

EuclideanClusterExtraction assumed the KdTree was returning sorted results, but it /defaulted/ to unsorted ones. This adds a check for which case is which.