Prove with a unit-test that min() and max() do not work for date.
Introduced a aggregate() function in the DAOFactory so code can be shared.

Also made rawSelect's data-types options more extensible and implemented
the "DATE" case.
Add a test for max(String) and min(String) and support BIGINT as well.