Add average, count in tree functions

For now the only option in tree views is "sum" which is cool, but
we need more functions like average and count. This is compatible
backwards with other gtk clients.
Merge pull request #8 from gisce/add_avg_count_tree_functions

Add average, count in tree functions