replce getCurrentScope and setCurrentScope by Module::getCurrent and Module::setCurrent. using the cache rather than static variables