Added hash lookup for metadata. Added optional path-based lookup, which are disabled because they use a lot of memory.