Partial implementation of bias calculations.
Complete implementation of bias calculation.

This includes an entropy calculation taken from the original
spreadsheet.