♻️ [RUMF-1424] factorize page exit logic (#1805) * ✨ [RUMF-1424] introduce the PageExitObservable * ♻️ [RUMF-1424] replace BEFORE_UNLOAD with PAGE_EXITED lifecycle event * ♻️ [RUMF-1424] use PageExitObservable in Batch * ♻️ [RUMF-1424] use page_exited for visibility hidden in segment collection * ✅ [RUMF-1424] add small test to make sure the Batch is flushing on page exit * ✅ [RUMF-1424] add a high level test to validate onPageExit subscription order * ✅ fix tests on IE11 * 👌✅ fix test case wording * 👌 use an exit reason instead of a boolean flag * 👌 use capture for the visibilitychange event * ✅👌 reword and collocate 'page exit' tests * 👌 use page exit reason directly as a creation reason