Various test framework fixes

Fixes a number of issues that caused tests to spin. Test run now finishes in about 10 minutes on my machine, with 1,280 failing tests. Still some tests are timing out (with new Timeout attribute from Wyatt), we can address those separately now.