MDL-44642 session: Add a client-side session keepalive system

For pages where there will be significant user interaction in which the
server is not updated, it may be necessary to poll the server periodically
to touch the session.

This makes use of the existing checknet script which was designed for
checking network connectivity but fits into this use-case reasonably well.
MDL-44642 grading: Add session keepalive during advanced grading setup