Replace all calls to $PAGE in layout files with a method of the renderer. This is so there is only one object that needs to be called that will contain all the methods required by a layout file (the output method can just call return $PAGE->bodyid for example).
Sample layout code:
<body id="<?php echo $OUTPUT->body_id()) ?>"
|
Note: Is it better to have a single call to <?php echo $OUTPUT->start_body($extraclasses) ?> IMO it's not better because the leaving the body tag in the layout files makes them look more like real html file and they display better in an IDE.