Changes to the event based task generation

This pull request supersedes https://github.com/gem/oq-engine/pull/1283

In addition to the changes there, it also implements the long awaited gmf-by-rupture feature and it is finally able
to improve the saving time of the GMFs by reducing the number of lines in the gmf_data data. Before it was

   n_rlzs * n_sources * n_ses * n_sites * n_imt (worst case)

now it is

    n_rlzs  * n_ses * n_sites * n_imt (worst case)

which makes an ENORMOUS difference in computations with a large number of sources.
The monitoring mechanism has been changed a bit to avoid logging millions of lines.