Abstracted structural recursion.
Remove alg debug logging.
Massive alg.js refactoring/cleanup.