Work in progress on listening to ON_REAP in mediator

merge with upstream