This more-or-less adds working BIDI support.
Man, I have this habit of leaving in debugging code.