Implementation of Percolation, PercolationStats and related files.