Redmine#6674 Modifying hashing function to add info about index boudaries

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.
(cherry picked from commit 0f84c0c4e0ff5d755cc2447918ffb2c3b8f24d46)
Adjust acceptance test for Redmine#6674
(cherry picked from commit 5e4b4c1bb1fc7506f60361f71cb8c392578c4709)
Fix test relying on specific order of getindices.

As getindices returned list is not guaranteed to be in any specific
order we should sort the results before comparing expected and actual
test results.
(cherry picked from commit 165a1c9feeaf06b456cdb782ecb2574a36a4d299)
Fixing arrays hashing.

To avoid having the same hashes for variables like a[10] and a1[0]
array boundary hash moved above index hashing.
(cherry picked from commit b87c03c1c8f5964fa34ae90252362ff4d5365671)
Test case testing multi-index array hashing updated.

Now cases like a[10] and a1[0] covered while checking if hashing is
working accurately.
(cherry picked from commit fca4d13eda78143ebb53dfcb819e76a40ca81e56)
Fix test relying on ordering of array elements returning by mergedata.

This one is simple change of expected strings. We can think how to modify
this test in future to sort the merged array elements before comparing.
(cherry picked from commit c065939cdbfe1130dca404be82db17172acaf30a)
Merge pull request #2041 from pasinskim/3.6.x

Redmine#6674 cherries