I am quite sure there are references dangling around which prevent module load/unload/reload to be transparent to the runtime. Two ways to go from here:
Audit the code and add weak references where feasible. This is a quite complex task.
Go for explicit removal instead. Perhaps implicit garbage collection was a stupid idea from the beginning and a callback should just save its parent module; when the module graph changes, all callbacks can be revisited and reevaluated for current fitness.
I am quite sure there are references dangling around which prevent module load/unload/reload to be transparent to the runtime. Two ways to go from here:
This needs a proper test suite.