Instead of caching all distances on disk, just calculate distances for the limit-set.
Fix for id handling in new KNN code.
Fix for new knn code.
And another fix for the new code.