anchor.diff:  
   %@doc Parses JID (username part) of an agent (ex.: agent_s-10829_1_7_18225d4f-e3f7-4c18-9a18-d6c06992d272_-g)
   parse_component_jid(User) ->
  -  lists:zip([component, version, cores, jobs, uuid, ukn], lists:map(fun utf8/1, strings:tokens(User, "_"))).
  +  lists:zip([component, version, cores, jobs, uuid, ukn], lists:map(fun bson:utf8/1, strings:tokens(User, "_"))).
   
   %@doc Creates a MonoDB document describing the connection
   doc_create_connection({User, Host, Resource}, IPAddress) ->
  
positive.code:   Lng = proplists:get_value(longitude, GeoData),
    Lat = proplists:get_value(latitude, GeoData),
  
    {user,         utf8(User),
     host,         utf8(Host),
     resource,     utf8(Resource),
     loc,          [Lng, Lat],
     connected_at, bson:timenow(),
     connected,    true}.
  
negative.code: 
    ok.
  
  on_set_presence(User, Server, Resource, _Packet) ->
    {IPAddress, _} = ejabberd_sm:get_user_ip(User, Server, Resource),
    handle_presence(connect, {User, Server, Resource}, IPAddress).
  on_unset_presence(User, Server, Resource, _Status) ->
    handle_presence(disconnect, {User, Server, Resource}, null).
  
  %@doc Handles presence stanzas sent by users
  handle_presence(UserState, JID, IPAddress) ->
    % Processes the stanza in the gen_server
    gen_server:cast(?MODULE, {UserState, JID, IPAddress}),
    report_event(Server, atom_to_list(UserState)),
    ok.
  