Replaces usage of Cmd with SafeCmd in WriteRef, SearchFilesByContent, SearchFilesByName, removeOriginInRepo