Standardize invocation counter for functions

Add: Every function implementation needs to provide an invocation counter for counting the amount of times the invoke() method is called.