anchor.diff:              Events = dict:store(JobName, new_job_ent(Pid, Stages), Events0),
               MsgBuf = dict:store(JobName, {0, 0, []}, MsgBuf0),
               spawn(fun() -> job_event_handler(JobName, From) end),
  -            {noreply, {Events, MsgBuf}}
  +            {noreply, S#state{events = Events, msgbuf = MsgBuf}}
       end;
  -handle_call(get_jobs, _From, {Events, _MsgBuf} = S) ->
  +handle_call(get_jobs, _F, #state{events = Events} = S) ->
       {reply, do_get_jobs(Events), S};
  -handle_call({get_job_msgs, JobName, Query, N}, _From, {_Events, MsgBuf} = S) ->
  -    {reply, do_get_job_msgs(JobName, Query, N, MsgBuf), S};
  -handle_call({get_results, JobName}, _From, {Events, _MsgBuf} = S) ->
  +handle_call({get_job_msgs, JobName, Query, N}, _F, #state{msgbuf = MB} = S) ->
  +    {reply, do_get_job_msgs(JobName, Query, N, MB), S};
  +handle_call({get_results, JobName}, _F, #state{events = Events} = S) ->
       {reply, do_get_results(JobName, Events), S};
  -handle_call({get_map_results, JobName}, _From, {Events, _MsgBuf} = S) ->
  +handle_call({get_map_results, JobName}, _F, #state{events = Events} = S) ->
       {reply, do_get_map_results(JobName, Events), S};
  -handle_call({job_initialized, JobName, JobEventHandler}, _From, S) ->
  +handle_call({job_initialized, JobName, JobEventHandler}, _F, S) ->
       ets:insert(event_files, {JobName, JobEventHandler}),
       S1 = add_event("master", JobName, <<"\"New job initialized!\"">>, none, S),
       {reply, ok, S1};
  -handle_call({get_jobinfo, JobName}, _From, {Events, _MsgBuf} = S) ->
  +handle_call({get_jobinfo, JobName}, _F, #state{events = Events} = S) ->
       {reply, do_get_jobinfo(JobName, Events), S}.
   
   -spec handle_cast(term(), state()) -> gs_noreply().
  
positive.code:         {error, {already_started, Server}} -> {ok, Server}
      end.
  
  % state :: {events dict, msgbuf dict}.
  % events dict: jobname -> { [event()], <start_time>, <job_coordinator_pid> }
  % msgbuf dict: jobname -> { <nmsgs>, <list-length>, [<msg>] }
  -type state() :: {dict(), dict()}.
  
  -spec init(_) -> gs_init().
  init(_Args) ->
      _ = ets:new(event_files, [named_table]),
      {ok, {dict:new(), dict:new()}}.
  
  -spec handle_call(term(), from(), state()) -> gs_reply(term()) | gs_noreply().
  
  handle_call({new_job, JobPrefix, Pid, Stages}, From, {Events0, MsgBuf0} = S) ->
      case unique_key(JobPrefix, Events0) of
          invalid_prefix ->
              {reply, {error, invalid_prefix}, S};
  
negative.code:     end.
  
  -spec do_add_job_event(host(), jobname(), binary(), event(), state()) -> state().
  do_add_job_event(Host, JobName, Msg, Event, #state{msgbuf = MsgBuf} = S) ->
      case dict:is_key(JobName, MsgBuf) of
          true -> add_event(Host, JobName, Msg, Event, S);
          false -> S
      end.
  
  add_event(Host0, JobName, Msg, Event,
            #state{events = Events, msgbuf = MsgBuf} = S) ->
      {ok, {NMsg, LstLen0, MsgLst0}} = dict:find(JobName, MsgBuf),
      Time = disco_util:format_timestamp(now()),
      Host = list_to_binary(Host0),
  