Clean up a lot of server code, remove dead code.