More statistics operations

Added GetTotalPurchased in product and productPackage managers to sum
the grand total of either products or packages bought. Created test
cases. Fixed an error in a different test case.