Switch to TreeSets and TreeMaps

Slower but allows case insensivity