Start code to implement Monte Carlo in trunk (ported from code mistakenly started in tag xmd-2.5.38.
Initial import of XMD 2.5.37 into trunk.