Move from using "dirname $0" to "dirname ${BASH_SOURCE[0]}"