extract rvm version check to functions/cli, update #2388