Adds the concept of constraint indexes.

Indexes can be marked as constraint indexes (owned by a constraints), and the owning constraint gets stored in the IndexRule.

On startup, constraint indexes that don't have an owning constraint gets removed.
(in a way that should work with HA this time).

This reverts da70c02a7e0b20a10ebaeb73fc842619840374eb, thus redoing:
   453d4cb88220e9d5c74262a7d0ba6c586e9e0a32