Rewrite of HTML minification function. Various minor rewrites.