Authcache: Getting user_link to work in template.php Problem

I'm trying to set-up an Authcache customised menu. 

The first way of doing it would be to create 3 menus, one for each of my roles and one for anon then create a custom tpl.php for each using the user_link and user_name variables. 

(These variables are provided by the user example module in authcache to all templates.) 

Block logic would then give the correct user the correct menu.

It seems a little clumsy.

Is it possible to grab the links inside template.php and use user_link and user_name variables there because I can't find a function which has the links available.

Or how has anyone else solved this problem?
Ok so here is my solution.

Menu's are themed in MYTHEME_preprocess_page, the menu data is also still structured here unlike in MYTHEME_preprocess_menu_tree.

I enabled the memcached example module, this enables the variables user_link and user_name in the preprocess. Then I created a third variable user_account just copying from the other two and altered the cookie so it stores uid not name.

This is because I wanted the "My Account" link to link to "user/x/edit" and I didn't need the name.

I then added the following chunk to my page preprocess.

function MYTHEME_preprocess_page (&amp;$vars) {
  $user_account = $vars['user_account'];
    if (array_key_exists('menu-xxxx', $vars['secondary_menu'])) { 
      $vars['secondary_menu']['menu-xxxx']['href'] = $user_account; 
    }


The secondary menu in this case is my user menu and My Account is always labelled menu-xxxx in the array. (xxxx will be numbers).