Updates to add a distance log cache to save on lookups and to do bulk loading of distances