code: Map<String, JSModule> getModulesByName() {
      Map<String, JSModule> result = new HashMap<>();
      for (JSModule m : modules) {
        result.put(m.getName(), m);
      }
      return result;
    }
docs: Gets all modules indexed by name.