optionally hide main window instead of closing

closes #104