Abtracted away aggregation functions used.
Added aggregation functions.
Added unit tests.