gdb was showing <anonymous enum> instead of useful stuff, so name all our enums.
I couldn't measure significant performance gains out of this; maybe about 5% (with one million Malayalam strings). Still, not bad. But reminds me that optimizing this codebase without profiling first is simply not going to work. Oh well...
Mozilla bug 701637 and 714067 combined. Patch from Jonathan Kew.