John Resig - Testing, Performance Analysis, and jQuery 1.4
developer.yahoo.com
developer.yahoo.com
http://github.com/jquery/jquery/tree/omgrequire/src/
And here's a direct link to the function itself:
http://github.com/jquery/jquery/blob/998cb005fc378188b3bae31...
Obviously you need to restrict the use somewhat for this to work (no conditional includes, for example).