Add support for registering objects in script objects.