Caching and fixes

Only load html entities dictionary once and then cache it
Fix incorrect error checking when loading entities dictionary
Check for nil data before attempting to parse entities dictionary