Implement stub classes for WorkerGlobalScope and DedicatedWorkerGlobalScope.

Part of #2811.