anchor.diff:  apply_erl(Fun, Data) ->
       Fun(Data).
   
  +-spec aggregate_reduce([{string(), term()}, ...]) 
  +          -> [{string(), [term()]}, ...].
  +aggregate_reduce([{_K, _V} | _T] = Data) ->
  +    Fun = fun({K, V}, AccIn) ->
  +                  case lists:keyfind(K, 1, AccIn) of
  +                      false ->
  +                          [{K, [V]} | AccIn];
  +                      {K, VL} ->
  +                          lists:keyreplace(K, 1, AccIn, {K, [V | VL]})
  +                  end
  +          end,
  +    lists:foldl(Fun, [], Data).
  +
  +
   %% @doc applies Fun with Args withing JSVM.
   -spec apply_js(Fun::binary(), Args::[term()], JSVM::port()) -> term().
   apply_js(FunBin, Data, VM) ->
       AutoJS = define_auto_js(FunBin, Data),
       {ok, Result} = js:eval(VM, AutoJS),
  -    Result.
  +    io:format("js:eval returned ~p~n", [Result]),
  +    decode(Result).
   
   %% @doc create a self calling JS function.
   %%      takes a anonymous JS function (as a binary string) and a list of
  
positive.code:     return(DHTNodeGroup, lists:flatten([apply_erl(Fun, X) || X <- Data]));
  work(DHTNodeGroup, {_Round, reduce, {erlanon, FunBin}, Data}) ->
      Fun = binary_to_term(FunBin, [safe]),
      return(DHTNodeGroup, apply_erl(Fun, Data));
  
  work(DHTNodeGroup, {_Round, map, {jsanon, FunBin}, Data}) ->
      %% ?TRACE("worker: should apply ~p to ~p~n", [FunBin, Data]),
  
negative.code: 
  -define(TRACE(X, Y), ok).
  %% -define(TRACE(X, Y), io:format(X, Y)).
  
  -behaviour(gen_component).
  
  