Move ensureExecuted outside of the Loader class.
Remove `$CodeHasExecuted` and `$CodeSetExecuted` in favor of a `WeakMap`.