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.
Removing unused code
Enforcing JSHint's undef option
Enforcing JSHint's noarg and nonbsp options
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.
fix typo
Merge pull request #5075 from coolwanglu/master

fix typo
Fix loading of PDF files with invalid or missing Type3 characters (issue 5039)
Optimize Ref_toString().

I have a large PDF where this function is called 1.6 million times
during loading. Minimizing the string concatenations reduces the
cumulative allocations done by Firefox within this function from 113 MB
to 48 MB.
Version 1.0.473
Merge pull request #5080 from yurydelendik/ver-1.0.473

Version 1.0.473
Fixes typo in promises implementation for legacy browsers
Merge pull request #5081 from timvandermeij/promises-typo

Fixes typo in promises implementation for legacy browsers
Initialize PDFView.url = ''

The absence of this property caused the following error in PDFView.download:

   Cannot read property 'split' of undefined

This property was unset when the PDF was loaded through a typed array instead
of a URL. With the fix, the file name will default to "document.pdf", as
defined by getPDFFileNameFromURL in web/ui_utils.js
Use Array.join to build up strings in readPostScriptTable().

This avoids about 5 MiB of string allocations on one test case.
Merge pull request #5078 from nnethercote/Ref-toString

Optimize Ref_toString().
Merge pull request #5083 from Rob--W/pdfview-url-property

Initialize PDFView.url = ''
Added clip operator
Added fill, stroke, line-join & font attr