anchor.diff:              Nodename = proplists:get_value(nodename, Opts, node()),
               State = #state{serverid=Nodename,
                              data_root=DataRoot,
  -                           ets_tabs=new_ets_tab()},
  +                           ets_tabs=new_ets_tab(),
  +                           iterators=new_ets_tab()},
               init_manifest(State),
               %% TODO: should do this out-of-band from startup so we don't block
               init_from_files(State),
  
positive.code:     close_manifest(),
      ok.
  
  
  %% @private
  -spec code_change(term() | {down, term()}, #state{}, term()) -> {ok, #state{}}.
  code_change(_OldVsn, State, _Extra) ->
  
negative.code:        (is_binary(SubPrefix) orelse is_atom(SubPrefix)) ->
      gen_server:call(?SERVER, {iterator, FullPrefix, KeyMatch}, infinity).
  
  %% @doc Create an iterator on `Node'. This allows for remote iteration by having
  %% the metadata manager keep track of the actual iterator (since ets continuations cannot
  %% cross node boundaries). The iterator created iterates all full-prefixes. Once created
  %% the rest of the iterator API may be used as usual.
  -spec remote_iterator(node()) -> remote_iterator().
  remote_iterator(Node) ->
      remote_iterator(Node, undefined).
  
  %% @doc Create an iterator on `Node'. This allows for remote iteration
  %% by having the metadata manager keep track of the actual iterator
  %% (since ets continuations cannot cross node boundaries). When
  %% `Perfix' is not a full prefix, the iterator created iterates all
  %% sub-prefixes under `Prefix'. Otherse, the iterator iterates all keys
  %% under a prefix. Once created the rest of the iterator API may be used as usual.
  -spec remote_iterator(node(), metadata_prefix() | binary() | atom()) -> remote_iterator().
  remote_iterator(Node, Prefix) when is_atom(Prefix) or is_binary(Prefix) ->
      Ref = gen_server:call({?SERVER, Node}, {remote_iterator, undefined, Prefix}),
      #remote_iterator{ref=Ref,prefix=Prefix,node=Node};
  remote_iterator(Node, FullPrefix) when is_tuple(FullPrefix) ->
      Ref = gen_server:call({?SERVER, Node}, {remote_iterator, FullPrefix, undefined}),
      #remote_iterator{ref=Ref,prefix=FullPrefix,node=Node}.
  
  %% @doc advance the iterator by one key, full-prefix or sub-prefix
  -spec iterate(metadata_iterator() | remote_iterator()) -> metadata_iterator() | remote_iterator().
  iterate(It=#remote_iterator{ref=Ref,node=Node}) ->
      gen_server:call({?SERVER, Node}, {iterate, Ref}),
      It;
  iterate(Iterator) ->
      gen_server:call(?SERVER, {iterate, Iterator}, infinity).
  
  %% @doc return the full-prefix or prefix being iterated by this iterator. If the iterator is a
  %% full-prefix iterator undefined is returned.
  -spec iterator_prefix(metadata_iterator() | remote_iterator()) ->
                               metadata_prefix() | undefined | binary() | atom().
  iterator_prefix(#remote_iterator{prefix=Prefix}) -> Prefix;
  iterator_prefix(#metadata_iterator{prefix=undefined,match=undefined}) -> undefined;
  iterator_prefix(#metadata_iterator{prefix=undefined,match=Prefix}) -> Prefix;
  iterator_prefix(#metadata_iterator{prefix=Prefix}) -> Prefix.
  
  %% @doc return the key and object or the prefix pointed to by the iterator
  -spec iterator_value(metadata_iterator() | remote_iterator()) ->
                              {metadata_key(), metadata_object()} |
                              metadata_prefix() | binary() | atom().
  iterator_value(#remote_iterator{ref=Ref,node=Node}) ->
      gen_server:call({?SERVER, Node}, {iterator_value, Ref});
  iterator_value(#metadata_iterator{prefix=undefined,match=undefined,pos=Pos}) -> Pos;
  iterator_value(#metadata_iterator{obj=Obj}) -> Obj.
  
  %% @doc returns true if there are no more keys or prefixes to iterate over
  -spec iterator_done(metadata_iterator() | remote_iterator()) -> boolean().
  iterator_done(#remote_iterator{ref=Ref,node=Node}) ->
      gen_server:call({?SERVER, Node}, {iterator_done, Ref});
  iterator_done(#metadata_iterator{done=Done}) -> Done.
  
  %% @doc closes the iterator. This function only needs to be called on remote iterators.
  %% on local iterators it is a no-op.
  -spec iterator_close(metadata_iterator() | remote_iterator()) -> ok.
  iterator_close(#remote_iterator{ref=Ref,node=Node}) ->
      gen_server:call({?SERVER, Node}, {iterator_close, Ref});
  iterator_close(#metadata_iterator{}) -> ok.
  
  %% @doc Sets the value of a prefixed key. The most recently read context (see get/1)
  %% should be passed as the second argument to prevent unneccessary siblings.
  