Server is now run in its own thread.

Now gives the option to quit the server. Examples updated accordingly