LanguageManager unit tests

* Added new LanguageManager tests and included them in the headless tests run in PhantomJS.
* Updated Editor tests to use language instead of mode
* Code cleanup from #2844