Updated variable and function registration macros. Added script object factories.