Replace macros with runtime clause creation

delay/1 starts out with implementations for length/2 and univ/3 since
those two are somewhat special.  For all other supported goals, we
only know about the acceptable modes (via mode/1).  When someone calls
delay/1 with a goal for the first time, we build an equivalent when/2
goal and add it to the definition of delay/1.

This requires about the same amount of code, but avoids the complexity
of macros and paves the way for mode/1 to be used as part of our
public interface.
Define mode/1 using same conditions as when/2

This replaces the cryptic 'g' and 'n' atoms with more traditional
'ground' and 'nonvar' atoms.  mode/1 will eventually be part of the
module's public interface, so it should be legible.
Cut before calling when/2

Under the old code, one could call delay/1 with a fully instantiated
goal that fails.  Instead of failing as it should have, delay/1 would
loop forever.  delay/1 needs to cut away all other clauses as soon as
it finds a clause that matches.

The attached test case loops forever when this mistake occurs.
Rewrite to be module aware

The test suite passes, but that's partly because the suite is sparse.
It covers all common cases, but there are some important cases not
covered.

Look at the generated code for delay_followup/1, write failing tests
for the mistakes, then fix them.