Improved code structure.
Refactored event handlers.
Autodisplay for WMS change
+ fixed non-SDO 'rect'
+ a bit of a refactoring