Added TextInput class for textual input (WIP).

TextInput works for ANSI charset but not UTF8 (yet).

Some minor fixes/improvements.