Tests for PROFILE detection

Baby steps towards a tested install script, take 2:

This PR tests how the PROFILE is detected and simplifies conditions is the install function.
See https://github.com/creationix/nvm/pull/564/files#diff-b369c6b9dba398f0bc282f1e89980e67R6