Support malformed ID and CLASS attributes. Fixes issues #84, #85, and #86.