Made a term re-writing thingy. Let's try testing it.
Added a couple of test cases. Both pass.