Typo fixed + debugging code removed
Typo fixed + debugging code removed

NOTES: this is the original code by Enrico. Problems:
1. it does not work properly when backtracking occurs
2. there is no way to recover the list of delayed goals
3. it is likely to be not flexible enough to implement the
   scheduler

The plan is to completely change the architecture.

LPCIC/elpi