Move PDFHistory from viewer.js to its own file

As part of the process of slimming down viewer.js, this PR moves `PDFHistory` to its own file.