Re-implement undo action based on EntityContent.

Previously, SubmitEntityAction implemented the undo action based
on the EditEntity class, which is not applicable to non-entites
like redirects.

This patch re-implements the basic saving logic for use with undo
operations. The logic for doing token and permissions checks and
then saving the new content is pretty generic and could be re-used
for other tasks, but it's unclear where it should reside. A full
refactoring of core's EditPage would give us the relevant tools
for free.

Change-Id: I832bef721f481bf91375174ddecdd3c268ac8dd5