adding RTL support

adding direction to the properties fixes the code for RTL langauges.
$nbsp; is kind of like a bug for RTL as &nbsp always renders on right side and cursor position becomes wrong. using 160 is way to go. Try testing with 'ZERO WIDTH NO-BREAK SPACE' as well and see if that is a better choice but since that is a unicode i did not put that in.