Fix self-service recurring link on dashboard
This picks up on two of the issues that were blocking on
https://github.com/civicrm/civicrm-core/pull/18787 and
https://github.com/civicrm/civicrm-core/pull/18196
(but does not solve all of them). It
1) adds the basis for unit test cover and
2) separates the function for retrieving links
for self-service from back office user.
I think there is still some jumbling together of these concepts but
as long as we are careful to extend the tests as we extend the logic...
This fixes what I suspect is an oldish regression whereby the cancel link
for paypal std users was wrong