Improved escape and unescape of Android resources with HTML markup

Improved escape and unescape of resources with HTML markup, aligning them to how Android handle them, and adding specific unit tests.