fix __rvm_select so we can __rvm_use with param, update #1647
remove scripts/functions/state as it is unused
remove code duplication, fix #1647