Always write to terminal, and port to Windows

I'm submitting these together, as one depends on the other.

These patches makes Gti write to the TTY when possible, and ports the code to run on Windows.