Track document visibility in reading depth schema
Calculate the number of milliseconds that the page is visible for by
tracking how long the document is hidden for via the Page Visibility API
and subtracting that from the ReadingDepth.totalLength property.
- Add the supportsNavigationTiming function to remove the navStart module-level variable, which is only used in the logEvent function.
- Add the onLoad and onBeforeUnload functions, so that the order of execution can be better documented.