Document preview widget performance improvements

This turned out to be a lot more challenging than expected, and there were other issues that we hadn't discovered yet in the bugbashes, mostly around performance. For example, it wasn't possible to zoom large documents because of browser blocking, etc.

This PR includes a refactor of the document preview widget that brings the following fixes:

- Made preloading a large number of pages non-blocking
- Came up with a much more efficient page positioning approach
- Made it possible to zoom large documents
- Removed polling approach to check when page is correctly rendered
- General refactoring and structural improvements
- Improved performance of large documents in Chrome

This PR also incorporates #3325, as the refactoring caused quite a big merge conflict with that PR.