Way to bootstrap all your js and css files

I’ve been testing out JQuery plugins and CakePHP plugins and it gets really tedious adding the required libraries to the <head> tag individually. I’m gonna make a bootstrapper that loads it all automatically, but what happens if there are functions and classes with the same name. They’ll end up overriding each other. Is there a bootstrapper app available which will check for conflicting function names and stuff like that?

What about using namespacing? http://www.php.net/manual/en/language.namespaces.basics.php

I know how to namespace PHP classes but I’m talking about loading .js and .css files. I don’t know if theres a way to wrap those in namespaces without modifying the code of each file.

RequireJS maybe?

Understanding RequireJS for Effective JavaScript Module Loading