Refactoring server code to make the server restartable from the gui. Finished up the GUI.