Moved UI entry on top of text controller.
Formatting.
Simplification.
Added support for replacement character.
Fixed layout calculations of UTF-8 text.