Add an extension point for being notified when moving between the background and foreground (#260).