Added write_utf8 functions and test cases.
Corrected the generation of the special casing table.
Added different versions of to_(lower|title|upper) as they all do
slightly different things in Unicode. Added test case for these
functions.