Replace client pointers with references

References should be used when NULL is not necessary, but if there is a possibility of a NULL value, pointers should be used.

Also, in server functions, the stupid conversions from client to cn and back should be removed.

This might take a while to complete, and it will definitely mess up c++11's ability to merge even more.