Converting to C++ (slowly). Added server class and UDP test.