Documetation fixes

corrected the documentation for JSON_TYPE and added documentation for JSONValue.this
Make Tuple.toString conditional
Fix wost-case of quick sort
Added unittest for issue 7767
Replaced assignments with swaps; Fixed compilation error; misc.
(3.0/2.0) should have been (2.0/3.0)
One more swap, replace with swapAt
Fix shadow declaration in unittest and illegal implicit casts
Fix another break
Add specialized version of optimisticInsertionSort to use swaps, for ranges which don't support assignable elements.
Convert tabs to spaces
Merge optimisticInsertionSort into a single function; Revise documentation for sort.
Minor refactor
Fix possible stack corruption in std.net.curl

The HTTP and SMTP structs are used as value types. The delegate created
in onReceiveHeader stores a pointer to this HTTP as it needs to access
this.p so we potentially leak a reference to a stack variable here.

As the Impl struct is always allocated on the heap via RefCounted
storing a pointer to Impl is not an issue. So we move the delegate
generation out of HTTP and into impl to make sure it only stores a
pointer to Impl which will stay valid even if the original HTTP object
is moved.

Also reset some delegates in _basicHTTP and _basicFTP to avoid leaving
references to stack variables around.
Fix Issue 11738 - partialShuffle should actually _be_ a partial shuffle :-)

This patch fixes the problem that partialShuffle was in fact invariably
shuffling the whole of the input, undetected because there were unittests
only for randomShuffle.

As well as the fix I've added some unittests specifically for partialShuffle
to ensure that it works properly, and I've taken the opportunity to tweak a
couple of bits of Ddoc and tidy up the randomShuffle unittests.
More implicit array to bool
Merge pull request #1777 from yebblies/issue4733again

More implicit array to bool
Merge pull request #1735 from Xinok/master

Fix issue 7767 - worst case of quick sort
Merge pull request #1757 from jpf91/fixCurl

[urgent] Fix possible stack corruption in std.net.curl
Merge pull request #1773 from WebDrake/partial-shuffle

Fix Issue 11738 - partialShuffle should actually _be_ a partial shuffle :-)