Fix crash when parsing HTML with doctype in lower case.

It could be fixed in the template instead, but supporting it out of the box
is more user-friendly.
Don't crash if either Whoosh or ElasticSearch is not installed.

It's unlikely that both search engines are available in the same project.