Refactor file extension queries to be more consistent

It was very easy to forgot to check against all language file
extensions. This updates the internal API to have a unified API.
10 files changed