Rewrote the script userdata code to support cloning of arbitrary objects.