Fixed some pointer logic in alpha(), fixed some future memory leaks by
remembering to free up intermediate lists in alpha(), and changed the
semantics of nub() so that it now takes a pointer to a list (node**) and
replaces its argument with a new list without duplicates and frees the
original list.