Port more GUI functionality

Also `window-system` is deprecated in favour of `(display-graphic-p)`.