rewrite handling of patch update queue.
rewrite handling of patch update queue.

DrXyzzy/smc,tscholl2/smc,tscholl2/smc,DrXyzzy/smc,sagemathinc/smc,sagemathinc/smc,sagemathinc/smc,DrXyzzy/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,DrXyzzy/smc,tscholl2/smc