Fix HTML processing

Fixes:
* second search for char number after named replace (`&amp;#x41;` was converted to `A` instead of `&#x41`)
* `&Xdddd;` (with uppercase 'X') was not decoded
* decoding unicode characters with code >0x7FFF was broken on win32
* only small subset of named references was supported
* standard specific characters was not filtered or replaced
* erroneous entities (without ';') was not converted (but must be converted according to standard)

Optimization:
* process directly UTF-8 text, no need to convert to wstring and back
* exclude full text search-and-replace for each entity