Implement a minimal variable rewrite.

Implement a minimal variable rewrite including an implementation of tree
walking to find variables to rewrite.

Closes #55.