added opening of new MDI window, unless singletonWindow property is set
to true.
removed some dead code