Fix bug in simplification

* src/pf/expand.lua: Fix test for simple RHS.
Fix constant folder bug

* src/pf/expand.lua: Fix bug in constant folder.
Add range inference

* src/pf/expand.lua: Add range inference pass.