code: protected Map<String, IPackage> loadPackages(Scriptable cfg) throws URISyntaxException {
  		Object obj = cfg.get(PACKAGES_CONFIGPARAM, cfg);
  		Map<String, IPackage> packages = new HashMap<String, IPackage>();
  		if (obj instanceof Scriptable) {
  			for (Object id : ((Scriptable)obj).getIds()) {
  				if (id instanceof Number) {
  					Number i = (Number)id;
  					Object pkg = ((Scriptable)obj).get((Integer)i, (Scriptable)obj);
  					IPackage p = newPackage(pkg);
  					if (!packages.containsKey(p.getName())) {
  						packages.put(p.getName(), p);
  					}
  				}
  			}
  		}
  		return packages;
  	}
docs: Initializes and returns the map of packages based on the information in
  the server-side config JavaScript
  
  @param cfg
  The parsed config JavaScript as a properties map
  @return the package map
  @throws URISyntaxException