Move common definitions to common.sh

Source common.sh into other travis-ci shell scripts.