Factor test-helper out of tests

Bonus:
  - Fix test in `startstop.js`