Thanks to Martin and Bills' two fine posts and the thread started by Marc Grayson about the content of the main Moodle libraries and of course the developers guide have made Moodle's architecture a little clearer. Even so I am still very foggy. Please allow me to ask a quick question....
What is the accepted method of replacing functions that exist in the the big three libraries?
If there is a function in a new module which needs to replace say "print_header", then should it go into the module's "lib.php"? I guess so but I don't see such functions there. Perhaps it should go into a small localised and or renamed versions of the big three libraries such as "module_name/weblib.php? But I don't see those either, perhaps because replacing functions in the big three libraries is generally frowned upon, since it should be acheived by rewriting the that function, rather than by replicating it somewhere else?