Fixed $format setting (flipped "html" and "plain").  Simplified tag stripping.