Complete rewrite of the popupviewer for Binky

This one is heavily dependent on jQuery. The previous one was just a
quick merger into Binky.
The syntax is identical but plugins that used the current version will
not work anymore (e.g. imageflow which will receive an update shortly)