run_batch now has metadata_dir parameter to control metadata output