Allow native test scripts to return status, and fix so they work (redo PR #1780 to fix issue #1779)

cc #1780