Simplified and HTML lowered statement dumps

Initial import, adaptation, and cleanup of statement simplification, HTML dump. Original code by @zingales. This needs a review.
IMHO it would be cleaner to just have a new compile_to_html() call, rather than altering output based on filename patterns.