Fix indentation
Fix indentation and re-arrange provides
Refactor and add purpose statements
Fix Redex variable-not-otherwise-mentioned bug.

And add a test to keep it from happening again.