Updated JavaScript language detection and loading