improve head detection, move fetching code to base_fetch, update #2098
split __rvm_fetch_ruby into smaller pieces, update #2098
improved detection of download location with a fallback to mirror and ftp, fix #2098