Added the server code, which can be launched on the commandline.