Revert most of the changes to contrib.

This reverts most of the activity from past two weeks,
so it can be reapplied with better-organized history.
Import configure.ac
New testing system.

This system includes the following enhancements:

1. prelude.pure is pre-processed to include the files it's "using".
   This gets the output from those files into the prelude.log, whereas
   before it was not checked.

   This is implemented with  new file ``expand-prelude.sed.in`` that
   the autotools system will expand into your build directory.

2. There are two new sets of auxiliary files for testing; and these work slightly
   differently in the case of the prelude test and the other tests.
   First, there is the ``index.aux`` file. This specifies default
   compiler settings to be used when each test is run. Any PURE_FLAGS
   settings the user has explicitly provided will be applied after those
   defaults.

   The ``index.aux`` entry is also used by the Makefile to generate the
   golden log.

   For ordinary test files, there can also be a ``test0xx.aux`` file.
   This is a Pure script that, if present, will be run before
   ``test0xx.pure``. It should test what compiler settings are active,
   and exit with a nonzero status to skip running the associated test.

3. For the prelude, there is a ``prelude.aux`` file. This works
   differently. It should test compiler settings and print to stdout
   a string like "prelude-foo". In that case, the logfile that will be
   used to verify the prelude test will be ``test/prelude-foo.log``.
   (Different compiler settings might verify against different test
   logs.)

   I included here a stub for one alternate prelude logfile,
   ``prelude-list-opt.log``. This isn't made use of until a later
   commit.

   If any prelude test fails, ``run-tests -f`` will re-run all of the
   prelude tests. It seemed too complicated to try anything smarter.

All the *.aux scripts (including ``prelude.aux``) can rely on the prelude
being loaded when they are run.
Refactor list functions into separate file.
Markup tweaks to lists.
Curried vector and tuple constructors.

*  tuple2, tuple3, vector1, vector2, vector3

These are all nonsplicing.
Implement and deploy ==?

In particular, we use `==?` instead of `==` in the definition of `index`
/list. We add definitions for `member` /list and `delete` /list,
also based on `==?`
Optimized versions of existing list functions.
Add revmap.
Add efficient reverse to array.
Add reverse_onto to lists.

We also define reverse in terms of reverse_onto, as:

  reverse xs@(_:_)   = reverse_onto [] xs;

We don't do any more aggressive optimizing, such as:

  reverse (x:xs)     = reverse_onto [x] xs;

in order to be sure that improper tails (for xs) are always handled by reverse_onto.

Many "tacks" in lists.pure and prelude.pure are really uses of
reverse_onto, but we don't update them until a later commit, because
of a difficulty that emerged with strings.pure.
Port reverse_onto to strings.pure, and elsewhere.

A difficulty arose when porting reverse_onto to strings.pure:
Putting a ::type modifier onto the base argument will cause several
tests with infinite streams (test023, test024, test080) to fail.

Our solution is to have the stdlibs instead use a __std__::reverse_onto
that does minimal typechecking on its arguments. Functions should only
use this when they know that the second argument is a proper list (for
example, because they constructed it themselves).

Then the toplevel API is free to present a reverse_onto that does
typecheck its arguments. This returns a string value when the second
argument is a string and the base is coercable into one.

Deployed this reverse_onto in various places across the stdlibs.
More _onto functions.

catmap_onto, map_onto, revmap_onto, zip*_onto
Small optimization to some list thunks.

Thunks for +, filter, foldr, map, scanl, cat, zip* now refer to local
auxiliaries.

Cannot optimize in the same way:
    * init (either version)
    * span (reverse-based)
    * take (reverse-based)
    * takewhile (reverse-based)

test061 depends on the definition of foldr, so we update its logfile.
Also, at this point we split off a separate version of that test as
test091.pure, to be run when --enable=list-opt.
Tweak take, takewhile.
Make filter handle improper lists more gracefully.
Make all return last non-zero value.

For example:

    > all id [2,3,4];
    4

This works correctly with symbolic values (and improper tails)
but doesn't do some simplifications one might expect:

    > all id [2,3,x];
    x
    > all id [2,3,x,0];
    x&&0
    > all id [2,3,x,1,4];
    (x&&1)&&4

`any` behaves similarly. If these simplifications are to be
introduced, perhaps the place to do it would be with rules on `&&` and
`||`. Is it worth the speed hit?
Add extra fold functions to lists.
Add partition, span, split to lists.
Add catstream to prelude.