Move SidebarBeforeOutput hook to SidebarHookHandlers

Change-Id: Ia07502539777c5610d4655843377e5d57ec2ceb7