Add close_window function - Fixes #23