This is a replacement for #1046. It contains only the changes that (I think) are unlikely to be debated and don’t interfere with #995. I’d like to get this in quickly to get a green badge again. (Using 2 CPUs instead of one for valgrind should do the trick.)
I’ll open another PR on top of this to optimize the matrix. This will deserve more discussion and we should get #995 merged first.