deglobalization of $ADMIN; merged admin/adminlib.php into lib/adminlib.php; fixed includes and some other minor fixes