Added functionStats to track time/memory usage of a function