Complicated the history checking algorithm.

Still isn't right, though. Getting ready to rip it out by the roots.
Use date stamps to identify new bags.

Also removed printf-debugging.
In which I almost use globals...

... and writhe in self-loathing.