Preparations for migrating core to use JSON based i18n

LocalisationCache and Language have to take the JSON files into account
in deciding if a language is present or not.

Standardizing language validity checking with isSupportedLanguage
and isValidBuiltInCode.

Co-Authored-By: Niklas Laxström <niklas.laxstrom@gmail.com>
Co-Authored-By: Siebrand Mazeland <siebrand@kitano.nl>
Change-Id: I35bbb3a7a145fc48d14fff620407dff5ecfdd4fc