Don't take screenshots until all resources on the page have actually finished loading (success or error). This makes it possible to screenshot async pages that load resources asynchronously after the DOM ready event. The capture script will now wait for all such loads to complete before screenshotting. This also lets us support navigate events from within a test case.