Discard changes rewrite.

STUD-1860

@andy-armstrong and @benmcmorran Please review.

My sandbox has the final version of this. http://studio.cahrens.m.sandbox.edx.org/
Not yours, but this is another unnecessary pre-test.