fix a few max call stack size exceeded errors

resolves a RangeError when finalizing documents with many images and/or many pages.
bump version and commit js directory so we can use this forked module via git