Add IPC notifications for tracking and profiling

I know it doesn't matter in JS but Its my personal preference to have functions defined before they are called.