Revert "Cleanup just before removing the element"

This reverts commit ee2e93b6f598603659e41105f6e65271f8922627.
Revert "Trigger events only after the element is removed"

This reverts commit 80c80337ace868b4ed54c67c7b3f7fd3ddd1f683.
Revert "Popover: cleanup only after the element is removed"

This reverts commit cc2d39162a31674f5510906636a8c0304e591404.