Fix serverlist code style, const-correctness, and types

Also add more compatability code to the server and remove some debug lines.