Improved cleanup of pending entries

Fixes issue #14 making sure that cleanup of pending entries doesn't just
happen whenever the page is accessed, but rather on demand by clicking a
new link.