Completed (for now) IndexKMeans.