Refactor __rvm_select (possibly the entire selector)

__rvm_select and the rest of the selector code is one of the biggest RVM monoliths and could do with refactoring to minimise its surface area for bugs.