Test improvements

A host of improvements that while each have value in themselves, are done with an eye to making the least invasive change possible to implement permissions within this app.

This PR is probably easiest reviewed commit-by-commit.