Test tally data

Adds unit testing for the TallyData class and some restructuring of Tally/TallyData constructors.