Updates to ScriptReference to handle local and embedded resources