Question: is the firstLineMatch key active in tmLanguage files? I noticed that, when loading a LaTeX beamer file, with a \documentclass{beamer} command as the first line, the syntax is *not* switched to LaTeX Beamer, but plain LaTeX. Thanks!

It is active, but it currently doesn't take precedence over the file extension. You should be able to see it in action by pasting the text into a new file, which will also trigger the firstLineMatch based detection.