Code cleanup

4 commits that cleanup code by using more shell built-ins.
isn't "[[" a bashism? nvm.sh needs to work on all supported shells, including dash, ksh, zsh, etc.