Most tests updated to new code.

Not all of them work yet, but most do.