Find script directory.
Find script directory.

We used to find script directory using $0, but that will not work
in sourced scripts. Therefore we are now using ${BASH_SOURCE[0]} which
will work in sourced scripts, but requires Bash 3.0 or greater.

larsnystrom/lwt