Add a -headless flag which runs only the debugger server until a SIGINT is received.
Refactor to introduce client/server separation, including a typed client API and a HTTP REST server implementation. Refactor the terminal to be an API consumer.