Test-only `asap.setOnError` instead of public `asap.onerror`

This is a possible strategy for removing `asap.onerror` from #15.