Replace fixed rewriteTopDown/BottomUp methods with Rewriter objects
Add rewriter to solve arithmetic expressions using literals