changed subst to be clear that it traverses treewise
added tests for hof
added warning about testing nil