#13 Fixed reloading of the popup

The problem was that the optimized view was only loaded once in the
popup after the popup has been opened. The trick is to ping in regular
intervals if the page readyState is complete and in case it is not (i.e.
the popup has been reloaded after submit), reinitialise the optimized
popup again. It's also important to stop pinging after the popup is
inactive (popup.window is null).