Add rudimentary X Input Method support

Makes it possible to enter Chinese or Japanese text