Pure python implementation of the BiDi layout algorithm
