anchor.diff:  %% Comet callback: join a game and wait for the other player
   %% POST /<game-uuid>/join (data: name=AgentX)
   handle('POST', [Uuid, "join"], Req) ->
  -    Data = mochiweb_util:parse_qs(Req:recv_body()),
  +    Data = mochiweb_util:parse_qs(mochiweb_request:recv_body(Req)),
       Name = proplists:get_value("name", Data),
       {Game, Opponent} = gameserver:join(Name, Uuid),
       JSON = iolist_to_binary(mochijson2:encode({struct, [
           {"game", list_to_binary(Game)},
           {"opponent", list_to_binary(Opponent)}
       ]})),
  -    Req:ok({"application/javascript", JSON});
  +    mochiweb_request:ok({"application/javascript", JSON}, Req);
   
   %% Comet callback: play a hand and wait for the other players hand
   %% POST /<game-uuid>/attack (data: attack=rock)
  
positive.code: handle('GET', [UUID], Req) ->
      % make sure the URL ends with a slash ("/")
      % if not, redirect to the same URL with / appended
      case string:right(Req:get(path), 1) of
          "/" ->
              Req:serve_file("game.html", "./static");
          _ ->
              redirect(Req, UUID ++ "/")
      end;
  
negative.code:         {"your-attack", list_to_binary(Attack1)},
          {"their-attack", list_to_binary(Attack2)}
      ]})),
      mochiweb_request:ok({"application/javascript", JSON}, Req).
  
  redirect(Req, Path) ->
      Host = mochiweb_request:get_header_value("host", Req),
      Location = "http://" ++ Host ++ "/" ++ Path,
      mochiweb_request:respond({302, [{"Location", Location }], "Redirecting to " ++ Path ++ "\n"}, Req).
  