Port of FriBidi's Arabic shaping to Python