pp returns expression

* src/pf/utils.lua (pp): Return the pretty-printed expression, so we can
  use pp within expressions.
Better conditional simplification in optimize.lua

* src/pf/optimize.lua (simplify): Simplify "fail" in tests.  Recurse if
  we algebraically simplify a test, as there may be more possibilities
  for simplification in that case.