Popup management

This is the brackets-shell part of https://github.com/adobe/brackets/pull/4187.