Extracted script loader to js file for addition to minimal lib