RV partial cleanup: more arguments passed by reference, less inline functions, tests integrated into the testsuite