Replace fixed rewriteTopDown/BottomUp methods with Rewriter objects