Added a lot of the server lib code.