apply changes to page to save to local storage.

a proposed fix to #56

This appear to work correctly, as long as the page is not too long for the server to accept.

When the page is too big to be accepted by the server, an error appear on the server (with a trace), the client sees is that the page does not get forked back to the server and remains in localStorage - so at least nothing is lost. Better error handling is required on the server to handle this correctly.