We could maintain ownership in 'Chain' rather than 'Modules', though that'll
require a little more reordering in removeModules (if it's OK to just move the
Chain loop/remove_if to after the victim loop, then that's easy)
The main uncertainty I have about this change is whether it's safe to move the
Modules.erase from the start of the victim loop (in removeModules) to the end.
Is that OK? Or do some of the operations in the mody of that loop rely on the
entry to have already been removed from 'Modules'?)
Storing pointers to ModuleFiles that point into values owned by a unique_ptr worries me a little. Seems like there's a risk here of a dangling pointer getting left in Chain; I think it'd be more obvious this happened if the delete were explicit.