Fixed #20392 -- Added TestCase.setUpTestData()

Each TestCase is also now wrapped in a class-wide transaction.
Refactored some tests to take advantage of refs #20392.
Added a test to verify headers set by default middleware; refs #23939.
Review updates.