Refactor the way we give enumeration of index objects to both vector
both matrix.
Add an extension method to enumerate a collection and obtain a
dictionary with the elements of the collection as keys and integers as
values attached to them.