Rewrite core algorithm for 2007.2.
It now handles Perforce 2007.2
submits, which it was ignoring because of its assumption that all
locks are held for the duration of a transaction isn't true any
more. Also handle an uncommon edge case involving db.monitor.
Add lots of comments.