Simplify server code considerably (WIP).