Add alignment support for text elements

Add left and right alignment support for text elements.
Now user can simply set "x-alignment" property to "left", "middle" or "right", without setting "ref-x" property.