Implement pruning of all linear and constant terms from the expression tree, even if the root node is not linear.

#1