Backport from mx5: Replaced CaseInsensitiveMap with TreeMap.

Backport of a change in mx5-development.