fixed infinite loop with spaced importScripts parameters, made more tolerant
 improved trim of multiple scripts