Added support for average in planner.

Left this aggregate operation out from last commit by accident.