Add reference count to builtInFunctions.
This fixes a subtle issue with having multiple ScriptEnvironment
instances open. Previously, deleting one ScriptEnvironment would
cause builtInFunctions to be cleared for all environments.