Implement maintenance mode.

This puts the system into read-only mode, so the only changes that can
be made are to edit the system configuratoin (e.g. to turn off
maintenance mode.) This is useful if, for example. you are doing DB
maintenance and want to prevent writes.