Refactored population of meta-data about indexes. Added population for user-defined indexes. Updated a test. Fails on database restart. Part of #2028.