Done: Window management, output files

Closing of windows now independent. Using a g-singly-linked-list
to store all terminals. Also fixed output files so that only
the first terminal can output to the file.