Unit test preference cleanup, reuse test window for DocumentCommandHandlers-test

* Removes existing preferences in case `doLoadPreferences` was somehow wedged due to a previous failure.
* Make `DocumentCommandHandlers-test` run faster by reusing the test window.
* Update save as tests for inside and outside of workspace files