and corresponding event handlers in SCM. Contributed by Nanda Kumar. Recommitting after making sure that patch is clean.