Add server code.
Clean up a bit.