Tons of redistricting work.
Fix a bit of Redistricting SQL.
mysql_escape_string is deprecated and does not accept 2 arguments
Added error handling to inform what address range failed to get processed if SAGE fails a batch lookup.
Added purgenotes option to remove all notes without having to redistrict anything. Moved note deletion so that out of state notes don't get deleted when just doing instate
Added startfrom ADDRESS_ID option
Fix in-state note removal to work with the 'startfrom' option.
In-state notes are removed per batch to allow the script to be run multiple times starting from different address ids
No need to delete on per row basis
Improve logging when doing tasks
Tons of assorted changes.
Fix a batch memory leak, likely cause of out of memory errors.
Basic BCC cleanup script.

Takes care not to screw up the existing databases in both content
and presentation. Has options for both import and export of data
through the target instance.
Add change tracking to the import script.
Check for SQL errors and use default values
Added missing $db parameter to mysql_query() call.  Added explicit exit(0) to clearly delineate end of script.
Changed _mysql_query() to bb_mysql_query().
Added RedistrictingReports.php with basic summary outputting.
Added basic senate district counts reporting
Lots of code cleanup.