Redmine#6674 Modifying hashing function for multi-indexed arrays

When using multi-index arrays hash function is looping through each
character in index without modifying hashed value once moving form one
index to another. That's why entries like a[te][st], a[tes][t], a[t][e][st]
and all other variations are resulting in having exactly the same hash.
While trying to add new array entry to RB tree having the same characters
in indexes previous entry is updated instead of new one being created.
Given the large number of changes like this, we should consider changing the test over-all to have a global that gets updated by code that changes the variable count, so that all of the asserts can test against that global instead of using hard-coded numbers that have to be revised every time we change the test; changes just include changes to the global to make all existing references work right.