Add sh directive and replace bash function with sh function.

This PR covers the items discussed here https://github.com/creationix/nvm/commit/bc9c82cb9fa1dd13607b8d576a11f662980f16c5#commitcomment-3454570

nvm should work with sh and not enforce bash.

I've tested it with my setup (on Jenkins with default /bin/sh) and it works fine.