MDL-48356 moodle_formatter: Include moodle stuff if not available.

Note that this only happens when the executions are --dry-run,
normally CFG and other core stuff is available.

So, with this patch, we look for the passed "dirroot" parameter and
use it to include config.php. If it's not available for any reason
we just skip the hook execution and done.