Refactoring pdf-precaching and rendering.