MDL-38538 quiz auto-save. First draft JS and ajax code.

This mostly works, but of course the back-end is not yet written. Also
it fails to consider possible race conditions.