For blog ID 1, use a special temp table name, so we dont mess with global user tables. Add RENAME_TABLE statements to the end of the generated SQL file for any tables that need to be renamed from the $rename_tables array.
Add array_filter, to get rid of any empty IDs. Unsure how they got here, but ends up with trailing commas in the SQL, which is then invalid