extra: docs, tests and new functionality for the extra::stats module