Popup Work

Change the way popup views are tracked and move the refresh function to
main the new system should ensure popups are only displayed once.
(Popup on start is still broken)