[#45659157] Migrate to ARC
[#52233141] Restored clearActions and isPopoverVisible methods, which disappeared for some reason.
Moved import of ESCGMethods to later in file, so preprocessor symbols it depends on get defined first.