Switch from /bin/sh to /bin/bash

You have bashisms in your script and /bin/sh might not always be bash. In that case the script would fail (for example on Ubuntu).
Remove unneeded shebang in nvm.sh
Fixing indentation and adding a trailing newline.
Preventing an extra leading newline.
Create a `colorize_version` function that doesn't include the padding, for `nvm version`
Declare more variables as local
Fix nvm ls-remote and display uninstalled versions again. Fixes #359, closes #360
Merge pull request #361 from drkibitz/local-vars

Declare more variables as local
support FreeBSD's sha1(1) for integrity checks

In the absense of shasum(1) (which on FreeBSD is provided by Perl,
from ports) nvm falls back to sha1sum(1) which does not exist on
FreeBSD.  But FreeBSD does have sha1(1) so look for sha1(1) and use
it if present.

As part of this change, refactor the execution of the checksum
program down into nvm_checksum and also clean up some special-casing
of empty dist checksums, which is already handled by nvm_checksum.
Redo https://github.com/creationix/nvm/pull/345
Remove some new bashisms
Missed tests
tests: avoid reliance on nullglob

Some shells do not have a nullglob feature, including dash (default
/bin/sh on Ubuntu) and the Almquist shell (default /bin/sh on
FreeBSD).  An mv(1) command in setup_dir is failing due to a glob
not matching anything, so use a more widely supported construction.
fix ls command in dash

The `colorize_version` command fails in dash (default /bin/sh on
Ubuntu) with an error like:

  local: v0.2.3: bad variable name

Instead of using a local variable, interpolate the function argument
directly to avoid the error.
fix errors and portability issues in expr commands

Add double-quotes around all expr(1) left-hand-sides where the
argument is just a variable, to prevent syntax errors when the
variable is empty.

Also avoid the `expr match ...` variant as this is not defined in
POSIX and causes errors in some implementations, including
FreeBSD's.
fix errors due to use of unportable == operator

The `==` operator is not defined by POSIX and many test(1) (also
spelled `[`) implementations do not support it.  Replace uses of
`==` with the POSIX-conformant `=` equality operator.
fix logic error in nvm deactivate test
handle echo implementations that do not support `-e`
fix explicit version matching on FreeBSD

FreeBSD's regular expression library does not like the pattern used
for matching explicit version strings in `nvm_ls`.  Change the
pattern to something more specific that works on FreeBSD.
avoid nullglob in alias command