Refactor into common/client classes for client/server support

Example for https://github.com/deathcap/voxpopuli/issues/26