Updated to the latest confusionmatrix.py

Also added some extra functionality to grid.py itself.