Fix #905
(cherry picked from commit 6da8921b22878136867856851cd9cfbc9c534563)
Fix #1210
(cherry picked from commit ca8a6a8e6072463b5fd77c8dc498b392d4f984e7)
Properly escape HTML attribute values
(cherry picked from commit 02abc9e25b741901f523c19e0feaf4af9ab93f87)

Conflicts:
	ext/forms/element.c
	ext/tag.c
Removed unused declarations