Profile testdriver and refactoring

Could we use jn:project http://www.jsoniq.org/docs/JSONiq/html-single/index.html#idm56058416 here?