Refactor the sync pipeline
The sync pipeline has some qualities that make it difficult to implement metadata mirroring as currently stands. The major issue is that metadata files are being downloaded in many different places, based on a bunch of different booleans that are passed around through global state objects. It makes it really hard to manage keeping track of them.
Refactor to make metadata mirroring easier
So much of the logic is spread out that it makes it extremely difficult to manage. e.g. all of the metadata is downloaded in many separate functions. Also there are classes that would be better if they were just functions, and helper methods that should really just be inlined because they don't have a specific task.