Fix Issue 10322 - ensure RandomSample is initialized before use

This patch fixes a problem where the public methods .index() or .popFront() might be called without the first value of the sample having been determined, which would then cause spurious results.  The runtime initialization check currently performed in .front has been extended to those methods, with a number of tweaks to the implementation that result in an overall performance improvement.
    
In addition, the .index method has been made a @property, which I take to be an oversight of the original code.
Indeterministic unit tests are always dangerous. However, let's assume for the moment that there is no better way of writing the tests in question. In that case, the fact that the tests can fail with a small probability should be noted somewhere, and in such a way that it is obvious even to the non-statistically inclined (preferably in the immediate vicinity of the assertions in question).