job_coordinator: move the logic of of whether the task has all of the inputs to JC.
job_coordinator: if all of the deps of a stage have finished, it can finish.
job_coordinator: update the task_spec when there is new inputs or input is done.
job_coordinator: extract the add_inputs_to_data_map function.
job_coordinator: add inputs to the data_map as soon as they are available.

These inputs will be looked up in the future if the task fails for some reason.
The input ids should already be in the task_spec.
fix the send_termination_signal to avoid using out of date tasks.