Compatibility: refactor user agent detection
Compatibility: refactor user agent detection

This patch moves the user agent checks to the top of the file to reduce
duplication and to provide a clear overview of which user agent we are
detecting.

Moreover, we extract inline user agent checks as well and use existing
checks in more places. Finally, we fix the indenting in one place for
consistency.

a0preetham/pdf.js,a0preetham/pdf.js,Rob--W/pdf.js,skalnik/pdf.js,tinderboxhq/pdf.js,mainegreen/pdf.js,Shoobx/pdf.js,jasonjensen/pdf.js,caremerge/pdf.js,jasonjensen/pdf.js,adlerweb/pdf.js-Touch,Snuffleupagus/pdf.js,mukulmishra18/pdf.js,websirnik/pdf.js,timvandermeij/pdf.js,macroplant/pdf.js,mozilla/pdf.js,tinderboxhq/pdf.js,Shoobx/pdf.js,mainegreen/pdf.js,nawawi/pdf.js,showpad/mozilla-pdf.js,mysterlune/pdf.js,WhitesteinTechnologies/wt-vaadin-pdf.js,macroplant/pdf.js,showpad/mozilla-pdf.js,showpad/mozilla-pdf.js,Rob--W/pdf.js,1and1/pdf.js,1and1/pdf.js,yurydelendik/pdf.js,mozilla/pdf.js,caremerge/pdf.js,nawawi/pdf.js,timvandermeij/pdf.js,skalnik/pdf.js,Shoobx/pdf.js,yurydelendik/pdf.js,WhitesteinTechnologies/wt-vaadin-pdf.js,mozilla/pdf.js,xavier114fch/pdf.js,macroplant/pdf.js,timvandermeij/pdf.js,Snuffleupagus/pdf.js,ydfzgyj/pdf.js,adlerweb/pdf.js-Touch,xavier114fch/pdf.js,websirnik/pdf.js,nawawi/pdf.js,ydfzgyj/pdf.js,mysterlune/pdf.js,Snuffleupagus/pdf.js,mukulmishra18/pdf.js