by rlmumford: Big update to prepare for the new case/lead system.