Proper highlighting and pages sizes.

Pages are different sizes, and its impractical to fetch the width/height of each
page in the preprocessing function for the viewer. So do it on a page by page
basis in javascript caching the results. Previously it was assumed that all the
pages were the same size as the first page in the book.