Re-apply the changes provided by  0802 for backport

Preserve record order of subfields for authority heading extraction

When extracting headings from authority records we currently read the
subfields of a tag in configuration order.  We should, instead, read
them in record order, to preserve the desired sorting properties that
the cataloger has encoded in the record.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP#1238015 hide patron credit summary when disabled

When the circ.disable_patron_credit / "Disable Patron Credit" org unit
setting is disabled, also hide the patron credit summary information in
the bills interface.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Fix boolean lists; Better atom regex; Caching

First, we didn't need to make $last_type local, and it broke explicit
grouping anyway.  That's removed, and we now reset that (and a few more
like it) at calls to the top level parse() method.  This introduces a
situation where a long list of booleans could cause query plan problems,
so we limit the plan depth to 40 (20 ||'d conditions).

Second, we are smarter about finding the boundary of atoms.  Previous
to this commit, and curly brace could send the parser into a tailspin
from which it would not recover.  Now we use alternation instead of
a character class, which is much safer with the default multi-character
float syntax specifier.

Third, as a catch-all, if we can't parse the remained of a query we
now simply say so (when in debug mode) and go away, instead of risking
an infinite loop.  We do this via a final, unqualified "else" clause
in decompose().

Finally, instead of building 10+ regexp objects on each query parse,
cache them per QP subclass and reuse them.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>