Server writes to file. Miscellaneous changes. Only multithreading is left.