Improvements to reflections gathering and ModuleEnvironment API