Factor the window statements out into their own file, and
move the guts of _window_show and _window_hide into
functions.