Support for multiple forms in GUI

(Fixed the close operation closing app even if more forms remained)