refactor

Not to be merged yet. See notes on the refactor over in WardCunningham/Smallest-Federated-Wiki#403, and steps in #11