1 o Code simplification and refactoring:
2 - Our main loop has been simplified so that all important operations
3 happen inside events. Previously, some operations had to happen
4 outside the event loop, to prevent infinite sequences of event
5 activations. Closes ticket 25374.