Working implementation of profiling functions, with ability to do function inside function wrapping/profiling