Migrated Tally class from old code - need to add in support for batch-based statistics