Reduce code deuplication in batch.sh, source functions from auto_patcher, and refactor to auto_patcher to not run body commands unless it is not sourced from batch.sh
Move batch.sh commands to auto_patcher and call automatically if files not detected; allow legacy call from batch.sh via sourcing auto_patcher.