Set/clear autosave based on cookie.

A more likely use case than a user accidentally closing a window and losing work is that we have a server error after the form has already been submitted. At the point the server error comes through, the autosave will already have been erased.

This change introduced a cookie that is set on the client side via javascript and then modified upon successful save. If the save succeeds, the autosave and the cookie are erased.