cleaned up controller and calculator.js to use CRV in refactored R code