Move remove_temp_dir behavior to core to account for new temp_dir.