move check for noExitRuntime into exit(), and fix up tests
fix process.exit call for closure