code: function(layers) {
      var mods = Layers.modulesForLayers(layers);
      return _.every(_.map(mods, function(m) { return cartodb[m] !== undefined; }));
    }
docs: check if all the modules needed to create layers are loaded