Persistant Application in Mac OS X

fixes issue 936 - application stays open after the last window has been closed on Mac OS X