Minor tweaks to event framework.
Add terminal_writeline() and begin scrollback support.