Add explanation and small optimizations to languagetest