Factor out terminal escape sequences
factor out terminal control
little more
add in_stream to terminalcontrol functions