repl: emit 'reset' event when context is reset

Closes #1183.
repl: Use a domain to catch async errors safely

Fix #2031
readline: handle wide characters properly

Handle wide characters (such as あ, 谢, 고) as two column wide to make
cursor move properly.

Closes #555.
Closes #4994.