Fix rvm installation and use conditionals to speed up setup