You are given files with model specifications and files of metadata for them. Each specification file can have multiple metadata files associated with it. Design a system where you can search metadata files by the UID of the associated specification file and vice versa. Support efficient reassignment of metadata files to specification files.