Review and fix index implementation. Changes are: 1) Index name is no longer important, if fields and options match, index exists; 2) Fixed index element comparison. Previous implementation did not take into account the order of keys.