extract __rvm_setup_compile_environment and subfunctions to separate file