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/
Isn't ```publish == "discard_changes"```` safe without the test for non-falsiness?