Remove unused duplicate code from common.php
Remove code duplication in replace, wait-for, going and gone CLI runners.