Bugfix: Set main EventQueue's owner as early as possible.
Make ScriptFunction::GetFunctions() public.
Implement event for registering/unregistering script functions.

Fixes #3704
Removed the native:: prefix for built-in functions.