Refactored Lemma#by_completions and improved tests.
Refactored lib/statistics.