Avoid storing copies of the ruptures

This PR fixes the relational structure of the database tables for the ruptures. It also contains various optimizations. The saving time of the ruptures decreases significantly with a positive impact in the use case of few sites. Some numbers are listed in the corresponding ticket: https://bugs.launchpad.net/oq-engine/+bug/1266641

Notice the needed companion pull requests on hazardlib and nrmllib:

https://github.com/gem/oq-hazardlib/pull/168
https://github.com/gem/oq-nrmllib/pull/123

The relational structure of the logic tree realizations has been fixed too: https://bugs.launchpad.net/oq-engine/+bug/1288027
The tests are green: https://ci.openquake.org/job/zdevel_oq-engine/317/