Basic functionality working for the Server

No networking yet :(
This has all been extracted to common places.