This code is now in nrv.extension (and merged in master) and it look like @coderunner is going to rewrite it anyway...