Switch encode_entities() to html_enc()

This is pretty much a straight one-for-one swap with some minor goodness
in the form of the already wrapped up array handling in one case.

I did not do any refactoring of the code although some places looked
like they could use it.

Addresses issue #591.