Better modal dialog handling, new project window code