The previous CAST_MOD(Impl) for the action_router constructor was illegal because `this` is not yet of type Impl (because the subclass constructor has not run yet). The action_router now accepts std::function for its callbacks. Fixes #2519