anchor.diff:  make_new_path([{bind, P}|Rest], Bindings, Remaining, Acc) ->
       P2 = case couch_util:get_value({bind, P}, Bindings) of
           undefined -> << "undefined">>;
  -        P1 -> P1
  +        P1 ->
  +            iolist_to_binary(P1)
       end,
       make_new_path(Rest, Bindings, Remaining, [P2|Acc]);
   make_new_path([P|Rest], Bindings, Remaining, Acc) ->
  
positive.code:     end,
      path_to_list(R, [P1|Acc], DotDotCount).
  
  encode_query(Props) ->
      Props1 = lists:foldl(fun ({{bind, K}, V}, Acc) ->
          V1 = case is_list(V) orelse is_binary(V) of
              true -> V;
              false ->
                  % probably it's a number
                  quote_plus(V)
          end,
          [{K, V1} | Acc]
      end, [], Props),
      lists:flatten(mochiweb_util:urlencode(Props1)).
  
  to_binding({bind, V}) ->
      {bind, V};
  
negative.code: 
                      % build new path, reencode query args, eventually convert
                      % them to json
                      Bindings1 = maybe_encode_bindings(Bindings),
                      Path = binary_to_list(
                          iolist_to_binary([
                                  string:join(Parts, [?SEPARATOR]),
                                  [["?", mochiweb_util:urlencode(Bindings1)]
                                      || Bindings1 =/= [] ]
                              ])),
  
                      % if path is relative detect it and rewrite path
                      case mochiweb_util:safe_relative_path(Path) of
                          undefined ->
  