Add global before/after hooks.