emulation: Improve the handling of Tab and CJK fragments

Tab is converted to spaces when the content underneath is modified, instead of
when the cursor is moved over. Only the left part is converted to spaces, the
right part becomes a shorter tab.

Double wide characters are replaced by spaces when split in two.

https://bugzilla.gnome.org/show_bug.cgi?id=691972
https://bugzilla.gnome.org/show_bug.cgi?id=730343