parentheses around (callback)() and window.need instead of just need
fixed logic for optional callback parameter to work with objects passed as callback
check for being called with single parameter (only urls, making the code initially see urls as undefined)
improved handling of the out-of-alternative urls scenario
undid mistaken handling of optional callback parameter: callback.push can be used to test if it is not an array like urls, even if an object is passed as callback