Attach events on App::before() and App::after()

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