Issue #42: added method replacePlotHandlerWith() to set the plot handler, and return old value