sth: revert to simple `onerror` checking
gs: refactor function `$DONE`

refactor logic tree
add support for async test failures
ed.js: crude support for error typing
S8.7.1_A2: cache result of delete

`delete` has a side-effect and its
return value depends on this; cache result of
delete so when reporting result, we are always
reporting the result that made us fail, not the
result of a new delete
[pedantic]