Add rewriter debugging tool.
Add proper error reporting.
Merge pull request #15 from whitequark/rewriter

Add rewriter debugging tool