Small improvements to test.js

* Startup/shutdown for each test
* Retry test runs more quickly and checks a few additional conditions