Simplified and HTML lowered statement dumps

Initial import, adaptation, and cleanup of statement simplification, HTML dump. Original code by @zingales. This needs a review.
Removing the entire function, along with the same thing in the header, should not cause a compile error.