m_spanningtree Changes to TreeSocket::WriteLine() to avoid string copies

- Change argument type to a reference to avoid copies of the string object
- If the std::string implementation is using copy-on-write then calling operator[] on a mutable string results in a copy; avoid this by calling .c_str() instead
m_spanningtree Introduce command builders