Redo my recent PRs that broke tests

- Also includes some test refacoring.