Move some constants and helper functions out of the `PartialEvaluator` closure
Move some constants and helper functions out of the `PartialEvaluator` closure

This will simplify the `class` conversion in the next patch, and with modern JavaScript the moved code is still limited to the current module scope.

*Please note:* For improved consistency with our usual formatting, the `TILING_PATTERN`/`SHADING_PATTERN` constants where re-factored slightly.

macroplant/pdf.js,Shoobx/pdf.js,mozilla/pdf.js,showpad/mozilla-pdf.js,nawawi/pdf.js,macroplant/pdf.js,nawawi/pdf.js,Snuffleupagus/pdf.js,caremerge/pdf.js,Snuffleupagus/pdf.js,timvandermeij/pdf.js,mozilla/pdf.js,xavier114fch/pdf.js,mozilla/pdf.js,showpad/mozilla-pdf.js,timvandermeij/pdf.js,timvandermeij/pdf.js,Shoobx/pdf.js,Snuffleupagus/pdf.js,Shoobx/pdf.js,xavier114fch/pdf.js,macroplant/pdf.js,showpad/mozilla-pdf.js,caremerge/pdf.js,nawawi/pdf.js