Add module methods to RegistryHandler and fix memory leaks