Federation support

Resubmit of #36 against staging

Looks like I need a rebase again.  Will do that soon