emacs: Don't overwrite font lock for attributes, misc fixes

This addresses the font lock regression introduced by the earlier pull
request #14818 - attributes are no longer be highligted inside of comments
and strings.

Also add some font lock test infrastructure and some tests for attribute
font locking and fix some minor nits.