Codegen AVG

This uses the same logic as NDV, i.e. cross-compiling the Update and
Merge functions.

Change-Id: I93b5658402e1bfeed141a53f8e52f82952838e45
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4303
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins