Fix the TextLayerBuilder. Code is based on PDF.JS bab40caf7be4fb96.

Fixes the fallout from #8 .

@jazzido, can you please have a look at the PR? The code for the TextLayerBuilder is 1:1 from the PDF.JS repo at version bab40caf, so I think it should be okay. But maybe you spot a mistake I made by moving the code over.