[install script] Refactors NVM_SOURCE

Deduplication of the code that was defining the source to install NVM from.
Can this method check its first argument, and error out if it's not "git" or "script"?