anchor.diff:  %% list of attributes and leaves it up to the server to create an id for it.
   %% The attributes should be a list of binary key/value tuples.
   create_document({Server, ServerPort}, Database, Attributes) when is_list(Server), is_integer(ServerPort), is_list(Attributes) ->
  -    create_document({Server, ServerPort}, Database, {struct, Attributes});
  -create_document({Server, ServerPort}, Database, {struct, _} = Obj) when is_list(Server), is_integer(ServerPort) ->
       Url = build_uri(Database),
  -    JSON = list_to_binary(mochijson2:encode(Obj)),
  +    JSON = list_to_binary(engejson:encode(Attributes)),
       raw_request("POST", Server, ServerPort, Url, JSON).
   
   %% @spec create_document(DBServer::server_address(), Database::string(), DocumentID::string(), Attributes::any()) ->  {json, Response::any()} | {raw, Other::any()}
  
positive.code: %% @doc Set the specified (set of) attribute(s)
  set_value(Path, Value, Struct) when is_list(Path) ->
      [H | T] = lists:reverse(Path),
      set_val(T, Struct, {struct, [{H, Value}]});
  set_value(Key, Value, Struct) when is_binary(Key) ->
      extend(Struct, {struct, [{Key, Value}]}).
  
  %% @private
  set_val([], Struct, Result) ->
      extend(Struct, Result);
  set_val([Key | T], Struct, Result) ->
      set_val(T, Struct, {struct, [{Key, Result}]}).
  
  %% @private
  %% @doc To be used with the fold function
  
negative.code:     Design = [
          {<<"_id">>, list_to_binary("_design/" ++ ViewClass)},
          {<<"language">>, Language},
          {<<"views">>, [
              begin
                  case View of
                      {Name, Map} -> 
                          {Name, [{<<"map">>, Map}]};
                      {Name, Map, Reduce} ->
                          {Name, [{<<"map">>, Map}, {<<"reduce">>, Reduce}]}
                  end
              end || View <- Views
          ]}
      | Attributes],
      JSON = list_to_binary(engejson:encode(Design)),
      Url = build_uri(Database, "_design/" ++ ViewClass),
      raw_request("PUT", Server, ServerPort, Url, JSON).
  
  