Check for escape key to close, set up resize callbacks