[DF-4762] Enable BiDi by default. Refactor Trim functions.