Refactor issue migrator

In particular, this is now assumed to be a once-only operation, and issues
should be closed in the right place relative to their comments.