Minor misc tidies

We have too many different ways of doing this in our tests. Lots use `TestApplication.Factory.newManagedInstanceForTests()`. We should rationalise these (but not in this pull request).