This adds the workset algorithm. Its 2 key ingredients, the edge selection heuristic and edge/event dependency sets, will be improved in later merge requests. See also the step by step plain in #520 (closed).
Best to review per commit.
I also tested it by running the benchmarks with and without the workset algorithm, and running all tests with the workset algorithm. This didn't reveal any issues.