PN-6992: Widget-Modality.js updated to keep correct bean count

PN-6992: The YUI3 library only allows for a single modal overlay...but the internal bean counting mechanism didn't account for this. This refactor has made the internal STACK variable a 'global' variable, so that the internal bean counting mechanism keeps a valid count irregardless of the sandbox.