Patch Set 6: I would prefer that you didn't submit this

I agree with Matthias' suggestions. Please update with a new changeset.

I also refactored a couple classes out and collapsed things into DiscardChangesOperation.

I would also request that you do the tests in another gerrit changeset so we can avoid triggering the IP process for this.