Refactor and document configurable options for BaseTest

* Support user-configurable test options in a common manner
* The *caller* of `eraseTempDir` is now responsible for avoiding calls to the method if `PRESERVE_TEST_DIR` is true