Completed the example with also a client module.

Also a few cleanups for the server.