Map-based A-normalization/CSE

Tillmann suggested this, and it was easy. It seems a small change might
implement CSE.
Deal a bit with name clashes

This is needed to mix in ANormalForm with BetaReduction.
Add scalaz
BetaReduction: Improve error message
ANormalFormStateful: switch state to fix all cases

Now this seems to work for all combinations of settings (CSE
enabled/disabled, copy propagation enabled/disabled).

* for CSE, we need to be able to replace existing variables with other
  variables. Hence, thread a substitution map from variables to variables.
* this enables doing copy propagation of atomic terms. Hence, generalize
  the map to be from variables to terms.
* To test CSE, I added a duplicate binding to a test case, and this
  revealed a flaw: the existing map would not preserve both bindings
  with CSE disabled, so we need also a list of bindings to output at the
  end. (In fact, we need this list in alternative to the map, but this
  is not yet in the code).
* All these changes required significant refactorings.
* Update the ANormalFormTest.sc significantly.
ANormalForm: Abstract over state difference

The whole difference between CSE and non-CSE can indeed be encapsulated
by changing the state which is propagated, as done here.

Most of this commit just updates code threading the state and accessing
it.

The nontrivial bit was that CSE does an extra lookup - we ensure this
always fails in the non-CSE case.

This avoids giving the state a conditional type (with a Map interface in
one case, and without this interface in the other).

This commits also avoids representing and updating both kinds of
state (as done before).
Start creating test (WIP)