Partial merge of the data migration code.
Merge branch 'staging' into x-stevetest
Require babelsubs for the data migration.
tern: don't order_by ? because mysql is awful
tern: randomize again, but without mysql's "help"
tern: remove an extraneous save()

The subtitles_fetched_counter field is a magic Redis field.  It gets saved to
Redis the moment it gets set, so there's no reason to re-save the new SL --
it's just a waste of a database call.
tern: report metrics on version syncs correctly
Add teams migrations to the intermediate DMR code.
tern: report errors as metrics
Adjust frozen apps in the migration.  Send help.
More frozen edits.  Sigh.
Update the team models to match the new migrations.
tern: delete contentless, languageless languages
(cherry picked from commit 9d8997f4adad57cc099531736618098a6123e72a)
tern: log the various fixes of empty languages
(cherry picked from commit e104b9d953a483effb186af7a379373589b50fc3)
tern: log when we skip empty languages too
(cherry picked from commit a09f84a8ab7656e1684b0f500f2563e9b9a31ac4)
tern: log duplicate language version counts

This should help us get a handle on the duplicate language situation.  Are most
duplicate languages empty?  Is there usually one that has lots of versions while
the rest have few?  I don't know.  Let's find out.
(cherry picked from commit a9a57f1fb7384dfd3f92fe41aad2a2a5f47e5e5e)
tern: log subtitle counts for dupes too

Why not?  More data is good and we're not gonna run out of hard drive space.
(cherry picked from commit dafdda5838657ba2dd3a08e387a9b9a583b33cac)
tern: handle duplicate languages by stacking versions

This is pretty tricky, so we'll probably have to do some manual cleanup in a few
cases after the migration.  But I think it'll do the right thing for the most
part.
(cherry picked from commit f30b72010201908533bedf7e5c8a90892404cffc)
Merge branch 'staging' into x-stevetest
tern: fix release_writelock call
(cherry picked from commit 493b5ec8a2e10eb79b37afc9fb3f43a3de518211)