[5.0] Reintroduce ServiceProvider::when(), which allow registering/loading service provider only when events is fired.

Signed-off-by: crynobone <crynobone@gmail.com>