new enableRegisty and disableRegistry functions

I've created a module utils that contains two functions moved out from the event subscribers.
In this way anybody can use these functions in custom code without having to fire the events