Add basic support for aggregate functions.