at top of script variable firstScript cached as a reference to document....

...getElementsByTagName('script')[0]

firstScript is then used as place to insert new elements before.

Unfortunately, this fails if the firstScript node is deleted from the DOM
as part of the yepnope script processing.

I noticed this when using yepnope in a wordpress plugin. wordpress creates
a script element for configuration that is later deleted from DOM.

Ya gotta love corner cases :-P