Make QueueOptimizer easier to read.

QueueOptimizer is really hard to read. Enough so that it's blocking my
efforts to streamline the representation used for operator lists.

This patch improves its readability in the following ways.

- More descriptive variable names make the sequence checking much clearer,
  as do additional comments.

- The addState() functions now return the index of the first op past the
  sequence, instead of setting context.currentOperation to the last op of
  the sequence.

- The loop in optimize() is clearer.

- The array modification in the fourth addState() function is much clearer
  -- we're just removing trios of ops.

- All four |addState| functions are now more consistent with each other.

I used some debug printfs to find documents where these optimizations are
used and then checked that the number of optimized ops was the same before
and after my changes.
Minimize memory usage of font-related arrays.

This patch replaces some vanilla arrays with typed arrays, and avoids
some array copying.

It reduces the peak RSS when viewing
http://www.dynacw.co.jp/Portals/3/fontsamplepdf/sample_4942546800828.pdf
from ~940 MiB to ~750 MiB, and reduces its load time from 83 to 76 ms.
Optimize common cases in hexToStr().

This avoids the creation of over two million array objects when viewing
http://www.dynacw.co.jp/Portals/3/fontsamplepdf/sample_4942546800828.pdf,
and reduces load time from 76 to 73 ms.
Converting PDFFindBar and PDFFindController to classes
Load file:-URLs in the main thread.

QtWebKit does not support file:-URLs in Web Workers.
To solve this issue, I'm loading file:-URLs in the main thread
for generic builds. file:-URLs load relatively quick, so there
is no need for sophisticated load progress notifications.
Re-factor heuristics to recognize unknown glyphs for |toUnicode|
Adjust the heuristics to recognize more cases of unknown glyphs for |toUnicode| (issue 5070)
Compiles some of the FunctionType 4
Optimizes functions to not create arrays
Make IdentityCMaps more compact.

IdentityCMap uses an array to represent a 16-bit unsigned identity
function. This is very space-inefficient, and some files cause multiple
IdentityCMaps to be instantiated (e.g. the one from #4580 has 74).

This patch make the representation implicit.

When loading the PDF from issue #4580, this change reduces peak RSS from
~370 to ~280 MiB. It also improves overall speed on that PDF by ~30%,
going from 522 ms to 366 ms.
Merge pull request #5134 from yurydelendik/fun4

Improves speed of the functions
Merge pull request #5008 from nnethercote/better-QueueOpt

Make QueueOptimizer easier to read.
Optimize TextLayerBuilder_renderLayer() for text heavy documents.

This change improves the text layer creation of "normal" text heavy documents.
It changes 2 things:
 * If the text element is not rotated, it will neither calculate nor apply a
   textTransform: rotate(0deg) to the text layer element.
 * For scaling the text layer div, the context will measure the width of the
   text in the given font. For many text documents the font changes seldom.
   If the font stays the same, the context does not need to be set to a new font
   especially avoiding the temporary creation of the same font string over and
   over again.
Merge pull request #5095 from Snuffleupagus/issue-5070

Adjust the heuristics to recognize more cases of unknown glyphs for |toUnicode| (issue 5070)
Merge pull request #5007 from timvandermeij/pdfview-tlb

Converting PDFFindBar and PDFFindController to classes
Merge pull request #5071 from nnethercote/font-savings

Optimize a font-heavy document
Removes some bind() calls from fetchAsync
Fixes lint errors
Merge pull request #5141 from yurydelendik/master

Fixes lint errors
Merge pull request #5140 from yurydelendik/fetchAsync

Removes some bind() calls from fetchAsync