Make window.close() close the window.

Fixed #671.