amalgamation and alg2

The amalgamate function now runs through without returning an error
(though sometimes incorrectly displays a warning that one of the words
is not in the free group). I'm not yet sure whether it always returns
the correct result or not.