Refactor RJEnv and RJEval.