Encapsulate indexes in a Specification:

This now allows multiple indexes with the same keys but different order
on a model.

[ fix #3037 ]
Don't add a specification if it already exists