Offload helper functions to util.bash

Put createDirIfNeeded()  in util.bash