Make all regex modules throw the same exception on error.
Fix various small issues.

- Add CXX11_OVERRIDE to *Regex::Matches and *RegexFactory::Create.
- Fix documentation comment on regex_string.
- Fix various code duplication/layout issues.
Merge pull request #619 from SaberUK/master+regex-dedupe

Various regex module improvements.
m_spanningtree Changes to TreeSocket::WriteLine() to avoid string copies

- Change the type of the argument to const std::string&, this stops copies of the string object when sending a message to more servers
- 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