Extension:MassMessage/Progress tracking

When people send out a mass message, they have an interest in tracking the progress of their delivery to make sure it actually goes out. Currently this is a manual process, you need to check the account's contributions yourself as well as any errors. For cross-wiki deliveries this is an even more exhausting task. Previously the job queue gave some insight into how many jobs were queued, but that was always an estimate at best and now with the EventBus based system, it's totally useless.

The goal of this project will be to use a database table to keep track of the progress of a delivery and then send a notification when it's done. As a side-effect, we will also use this tracker to eliminate the biggest issue in MassMessage today: double posting.

Database schema
Two new database tables will be added:


 * : Each delivery gets one row here, with subject and pagelist, plus the origin wiki, with a bool for finished or not, and success and error count values. Maybe should also have a list of wikis where the errors happened?
 * : For each delivery, each target (page name, wiki) will get one row, linked to the deliveries table. There will be a bool for finished or not, and a result which might be success or some error message.
 * Targets for deliveries that have fully completed should be periodically deleted from the table to prevent it from growing too large.

Code flow
When the MassMessageSubmitJob runs, it will create a single row in message_deliveries. If this row already exists, the job will abort. It will then create a row per page in massmessage_targets when queuing jobs for each page.

Each MassMessageJob will check the massmessage_target row, if it's already marked as finished, abort (avoid double posting). Otherwise, it will process the delivery and update the database row on whether the target was successful or finished with an error.

Then it will check all the other rows to see if it was the last job to finish (TODO: race conditions? what if two jobs think they're last), and if so, queue another job to deliver an echo notification with the final result on the wiki the job was originally submitted from.

We will also provide an API module for getting the progress of a delivery for scripting. One possible idea would be to have the "Your message has been queued for delivery" message on Special:MassMessage have an AJAX script poll that API, updating a progress bar.