[refactor] test suite / libnrm bugfixes

This commit fixes the test suite, moving away from `dhrun`
to `shelltestrunner`. It also applies bugfixes to the
libnrm code to make those tests pass.
24 jobs for refactor-tests in 2 minutes and 56 seconds (queued for 2 seconds)