Fix removal of rectangles and electric fields, dispatch new events

[#48435497]
Add automated tests of electric fields

[#48435497] [#52998997]

Also test their relation with rectangles, especially when rectangle
is removed.
Dispatch 'changeElectricField' event when electric field is updated

[#52998997]

+ update automated tests.