Provenance handles custom FUNs

Fix for all makeXxxStat functions, and testing code. Addresses issue
#90.