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.