Fix initialization bug for the Notification class

refs #7780
Refactor the stack frame handling for scripts