function injectScript(src){
  return new Promise(function(resolve, reject) {
    window["__google_maps_callback__"] = function() {
      resolve('');
    }

    var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src;
    var t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s,t);
  });
}

exports.fetch = function(load) {
  var scriptUrl = load.address
  scriptUrl += (scriptUrl.indexOf('?') < 0)? '?' : '&';
  scriptUrl += "callback=__google_maps_callback__"
  return injectScript(scriptUrl).then(function() {
    return 'module.exports = google.maps';
  });
};

@@ -308,16 +308,29 @@
 pt')%5B0%5D;
+%0A    if (t) %7B
  t.paren
@@ -354,11 +354,97 @@
 e(s,
+ 
 t);
+ %7D%0A      else %7B var h = document.getElementsByTagName(%22head%22)%5B0%5D; h.appendChild(s); %7D
 %0A  %7D

attach script to head if there are no script elements present in DOM