IDE-1109

Add a method called findExistingCategory() to find the user typed duplicate categories, fixed the categories keys and values' order out of sync issue.