Extend local database once more.
This should hopefully add most of the features needed for the moment.
Improvements made:
- Normalize segment names by putting them in a separate table and
referring to them by ID everywhere else. This should help quite a bit,
since segment names are ~36 characters long. Add conversion functions
to the C++ code, which aren't optimized yet (we should cache results in
the C++ code and not re-query the database each time).
- Similarly, normalize snapshot names.
- Add an expired field to the object index, so that we can stop using
objects in future backups but still remember how old the data is.
Some more work is still needed in the C++ code, but the hope is that the
database schema itself will be more stable now.