refactor

Not to be merged yet, see notes on the current refactor over in Smallest-Federated-Wiki