Remove references to globals through `this` in AMD factories

Fixes #17829

(cherry picked from commit fa4028b647e38d4f1cc183e6db65022f80cb5423)
(cherry picked from commit dcebb97df09699d3e3517dac7189239e0b13880e)
(cherry picked from commit 713d6772018fe7fa164b178ba859bca9bea84181)

Conflicts:
	_base/config.js
	_base/window.js
	request/script.js