Accumulated minor improvements and documentation about handling stale data.
Backports of 7.x improvements for the 6.x version.
Working upgrade to D7, minimal refactoring from D6. Tested and being further developed on a new D7/CiviCRM4.2 fresh install, but should work fine for upgrading an existing D6 installation.
This version has been in use since April 2012 on two production sites with D6 and CiviCRM 3.4.8. It requires this patch:
http://issues.civicrm.org/jira/secure/attachment/15612/v3.4-getCount.patch
for a civicrm database of any reasonable size, as per the notes here:
http://forum.civicrm.org/index.php/topic,24597.msg103838.html