Currently the TermWindow class still manages a lot of the logic that should be abstracted inside of Interpreter or ScreenBuffer. As a result, the telnet interface depends on the TermWindow class, which in turn depends on running KSP. Separating this functionality would go a long way towards allowing kOS to run outside of KSP itself, which would dramatically improve the developer's ability to test new functionality and enable compiling scripts outside of KSP. After implementing, I would probably work on taking PR #1552 a new direction.