Pull request/1ad7f5a0 for Diversity package.

Latest version has some added functionality and a lot of cleaning and rationalisation of function argument order for consistency, but critically now has complete documentation (if not *brilliant* documentation) for everything in the package. Fix from previous attempt which had a test failure.