OTWO-2506 Update lang detector to prefer extension over emacs mode line

File extensions seems more reliable than emac line,
as a javascript file can have a java emac mode.