job_coordinator: use a gb_tree(group(), task()) for faster lookups.

Currently we don't do inverse lookups.
job_coordinator: simplify the send_outputs_to_consumers function.

This new function uses lists:foldl to be more succint and easier to read.
job_coordinator: remove an unnecessary assertion.

The assertion was a paranoid way of making sure there is no group-duplicates.
The gb_trees:insert function should do the same.
Merge pull request #523 from pooya/jc_optimize

Jc optimize