Better test for availability of cached implementations

Instead of statting each digest we want to check, read in all the cache
directories at the start of the solve and build a hashtable to test against.