Add function awareness to pkg mod_aggregate