Extract functions.

Big `highlight-defined--matcher-internal' is not exactly readable.