Reimplemented opening files and moved unnecessary code from window.c/.h into screen.c