Fix some namespace clashes and incorrectly named members.
Fix namespace clash in Network.hpp.
Fix incorrect type in SendFunctionPtr.
Bring ConnectionState implementation back into Endpoint.
Fix minor syntax errors.
Fix types of doRead* methods.
Fix calls to doWrite with references/pointers.