pgsimple: Replace calls to deprecated PostGIS functions.

With the 2.0 release, PostGIS removed lots of deprecated function,
including non-ST_-qualified forms of Collect and Envelope. These have
been deprecated around PostGIS 1.3 which was sometime in 2007. These
calls are now replaced with calls to ST_Collect and ST_Envelope.

Thanks to Walter Nordmann for pointing this out and proposing a solution.
pgsnapshot: Replace calls to deprecated PostGIS functions.

With the 2.0 release, PostGIS removed lots of deprecated function,
including non-ST_-qualified forms of Collect and Envelope. These have
been deprecated around PostGIS 1.3 which was sometime in 2007. These
calls are now replaced with calls to ST_Collect and ST_Envelope.

Thanks to Walter Nordmann for pointing this out and proposing a solution.
Add unit tests for the entity merge task.

Contains test cases for (+ stands for merge):
 * X + empty == X
 * empty + X == X
 * X + X == X
 * the three conflict resolution methods
 * the commutativity of version and timestamp methods
 * the non-commutativity of lastSource method
 * merging of two completely disjunct datasets
Refactor the convenience manual merge runner into a separate utility class.
Allow the client of the helper method to install its own exception handler
for the worker threads.
Add test cases for unsorted input streams passed to the entity merger.
Minor cleanup in change simplifier tests.

* Rename the common case test to something more distinct than test since
  there are more tests to come.
* Remove the misleading copy&pasted comment.
Add some more test cases for the change simplifier.

* Simplify an empty change
* Simplify an already "simple" change
* Bad sort order error cases
Add tests for the --flatten task.

* Empty stream
* Common case (multiple version of entities)
* Already flattened stream
Add a couple test cases for the --apply-change task.
Replace the private EmptySource class with EmptyReader from core.
Move the data files for the --apply-change tests into a subfolder.
Move the data files for the --merge tests into a subfolder.
Add a test with long change streams to improve coverage.

This covers the cases when all base stream entities
have been processed but some changes still remain
in the change stream.
Rewrite a misleading comment in the change applier.
Add test cases --apply-change with empty base and/or change inputs.
Generalize the merge run helper methods for all MultiSinkRunnableSources.

The methods in MergeTestUtil class were fairly generic already, but
required an EntityMerger object in the method signatures. However, the
functionality can also be reused for other similar tasks like
ChangeMerger and ChangeDeriver. This commits relaxes the type
requirements to all classes implementing MultiRunnableSinkSource and
moves the utility class to the testutil project, along with some style
and naming improvements.
Add a SinkChangeInspector class.

The class is similar to the SinkEntityInspector but works with
ChangeContainers instead of EntityContainers.
Refactor the thread heavy lifting into a separate method.

This is done to avoid code duplication when handling different sources
and sinks (entity vs. change). The code that actually controls the
source/sink threads depends only on Runnable.
Add helper methods to run MultiSinkRunnableChangeSources.