Improved the logic of detectTextDirectionality, allowing for obscure edge cases to be supported as expected.

Enyo-DCO-1.1-Signed-off-by: Blake Stephens <blake.stephens@lge.com>