processMicrotasks

Runs the queued work, including anything it queues in turn, until the queue is empty. Then the targets that WeakRef kept alive are let go, and a registry whose targets are gone gets a cleanup job, which runs here too.