Highlighter extension

This is the second (and final) batch of the work done during the hackathon, plus some internal refactoring, plus some cleanup.

See the commit messages for details.