LP#1243023: Teach oils_xpath() to decode specific enties in text nodes

Because of a behavioral change in Postgres' XML code (specifically, when
casting XML as TEXT, the Famous Five XML entities are not decoded), we
are seeing doubled encodings in XML and HTML output, as well as in indexed
data.  To combat this, we will now check the first character of each
array element returned by XPATH() and, if it is not '<', we will decode
the entities ourselves.

Also included in this commit is some cleanup of the surrounding file
content, which was just confusing and useless in the modern era.

The contents of his commit, followed by:

 =# drop function evergreen.oils_xpath(text,text,anyarray)

are enough to address the OP's complaint about browse data.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1243023: Clean up string handling variable types

It was already TEXT, no need to flip back and forth between that
and XML.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1243023: Make sure URLs are not broken

We need to make sure that the URLs we extract contain decoded Famous Five
characters, not entities.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1243023: Clean up string handling variable types

Similar to the previous commit, this was really TEXT, no need to flip
back and forth between that and XML.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1243023 Add upgrade script and pgTAP test

For fixes to XPATH extraction encoding.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1243023: Add optional quick reingest to upgrade script

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1243023: Stamping upgrade script for oils_expath-tweaks

Signed-off-by: Ben Shum <bshum@biblio.org>