Fix bug in Trie generation, that leeds to incorrect behaviour of toUpper

Also fixes a typo in generic toCase.
issue 9629 was fixed in new std.uni; add a test case
add tests for issue 11089