Fixed caching of libraries so they are sorted into nested dicts that match the directory structure they're found in.