moved is_terminal to FunctionNode. A FunctionNode is a terminal if it doesn't contain any FunctionNodes below
fixed is_terminal again
fixed depth problem in increment_tree, fixed corner case in FunctionNode.is_terminal
Fixed insanely subtle bug in Grammar -- x in a lambda overwrote x in outer scope