Moved context from Hit to Hits; keep Hits sort order in Integer array.

The object of these changes is to make the Hit class immutable so instances can be reused. The 'hits' instance variable of the Hits class could now be shared between multiple Hits instances with different sorts, contexts, etc.

As a result of this change, the HitProperty classes now all take a Hits object (the Hits object you're going to sort/group) and internally compare Hit objects based on their "original" index (the order in which they were added to Hits). Other than that, no changes to your code should be necessary.
Added methods to Hits, DocResults and Searcher as a replacement of manual object instantiation by client.

* The awkwardly named classes RandomAccessGroup(-s) were renamed to HitGroup(-s). Also, DocGrouper was renamed to DocGroups to match this naming scheme. The old versions are still around but have been deprecated.
* Manual object construction was replaced with method calls where possible, for convenience, speed and ease of refactoring. Examples: use Hits.window() instead of new HitsWindow(); use Hits.groupedBy() instead of new ResultsGrouper(); use DocResults.groupedBy() instead of new DocGroups(). (code to the HitGroups/DocGroups APIs instead of to the concrete type ResultsGrouper/DocGrouper)
* If you just want to query documents (not find hits for a pattern), use Searcher.queryDocuments(Query) (returns DocResults without hits).
* Preferably use Hits.sortedBy() (returns a new Hits instance) instead of Hits.sort() (modifies Hits instance). In a future version, we want Hits to become immutable to facilitate caching in a multithreaded application. Note that although you get a new Hits instance, the hits themselves are not all copied.
* Visibility for some internal classes and methods has been reduced from public to package-private to trim the public API footprint, promoting ease-of-use and facilitating future refactoring. This should not affect applications. If it does affect you, please let me know.
* Some other methods have been renamed, are no longer needed, etc. and have been deprecated. Deprecated methods state the preferred alternative in the @deprecated Javadoc directive.
Changed default log4j format in LogUtil.
Fixed bug in SpanQueryBase.extractTerms() that occurred when searching for all tokens.

(i.e. CorpusQL query [])
Fixed potential NullPointerException in PropertiesUtil.getBooleanProp.
Added OpenSonar-specific indexer.
Made DocIndexerXmlHandlers.describePosition public.

This way, subclasses can use it to indicate where an error occurred as
well.
Added serialization/deserialization to HitProperty.

This is convenient for BlackLab Server and other applications, which
need to pass HitProperties as part of URLs.
Fixed Hits.sortedBy() not making a copy of HitProperty argument.

This is necessary because it also makes a copy of the Hits object,
which HitProperty needs access to.
IndexStructure.getComplexFieldDesc() now throws Exception on error.

i.e. if the field specified doesn't exist. The same was done for the
other get...(name) methods in IndexStructure.
Fixes to HitProperty/HitPropValue (de)serializations
Changed HitPropertyValue to only need a property name, not a field name.

The field name is taken from the Hits object passed to the constructor (or deserialize() method). Using another field makes no sense anyway.
Added (de)serialization to DocProperty and DocGroupProperty
Some changes to DocResults/-Groups to benefit BlackLab Server.

Made the original hits / docresults object accessible; Added .window() method to DocResults like hits has.
Fixed newlines not being escaped in StringUtil.escapeDoubleQuotedString()
Updated DocIndexerXmlHandlers to ignore DTD declarations.

It used to download them every time, but not all sites appreciate when you rapid-fire requests at them. :-)
Fixed Hits.getHitsInDoc() not ensuring all hits are read first.
Changed Searcher.queryDocuments() to return all documents when no query is given.
Added SingleDocIdFilter to filter Hits on a single document (for highlighting).
Changed StringUtil.wrapText() to use StringBuilder.

This speeds up the method for long input strings.