Support for scope in during() and after() methods

Added support for function call scope in case of after and during methods.