Simplified and HTML lowered statement dumps

Initial import, adaptation, and cleanup of statement simplification, HTML dump. Original code by @zingales. This needs a review.
I didn't see any documentation that convinced me if it was immutable or not, and re-lowering was way safer. If, however, there are no side-effect to the original f.lowered, by running substitute then by all means we should use f.lowered.