Added profilehooks to do profiling of functions

Use @profile decorator to profile