Making sure we call ToArray on MemoryStreams instead of GetBuffer, see http://stackoverflow.com/questions/3779690/xml-serialization-appending-the-0-backslash-0-or-null-character and http://msdn.microsoft.com/en-us/library/system.io.memorystream.getbuffer.aspx (read the remarks section)
Added option to enable TCP connection sharing to improve ravendb performance, closes #251