Added LModule.onBeforeDispatch and LModule.onDispatch events