Cleanup and fast-path optimization of installTrChar and translateChar.