[core] Solve issue where reloading module caused duplicate calls

Functions were not replacing their old versions when reloaded, due to the
previous fix to them replacing other functions with the same name. Now,
the key is module_name.function_name, which should avoid both problems.