This PR is based off https://github.com/edx/edx-platform/pull/2994 and this code is part of that PR. Let's please keep the review comments for code introduced by 2994 in 2994 to keep the reviews manageable.

I'll add the comment Ned suggested in 2994. Regarding language changes, I think the best thing to do is to merge this in, then for you and @marcotuts to hash out what you'd line in a follow-up PR.