Server moved to a namespace. Some minor cleanup to have less dangling global variables, but this is easier to work with overall.