Move closed-over state inside of ModuleStore class