Finished rewrite and debugged server.