refactor

Not to be merged yet, see notes on the current refactor over in WardCunningham/Smallest-Federated-Wiki#403, and steps in #48