Added testing for database functions

MIN, MAX, COUNT, AVG functions are now all tested. However, I might
still want to test for the various NUMERIC types as only INTEGER_64 on
primary_key is tested in the average.