Introduce and use the $LINK, $USER, and $CONTEXT globals to align
coding patterns with Moodle.