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.
Because of `ksh`, the `local` declaration, and the variable assignment, must be done in separate lines:
```
local NVM_PROFILE
NVM_PROFILE=$(nvm_detect_profile)
```