Updated script loader to work across ie8 and ie9