[install script] Refactors NVM_SOURCE

Deduplication of the code that was defining the source to install NVM from.
for all of these, can the error messages include the actual output, for debugging?