Split server.cpp to multiple files
Remove dead code