i18n function; use mw.config.get to get wikiGlobals; executing RTL initially

Get a message:
_msg('key')

Using always mw.config.get() to access wikiGlobals listed at
http://www.mediawiki.org/wiki/Manual:Interface/JavaScript#mw.config

Only executing the RTL check once and then return the stored result instead.

Since wgDBname is used twice, make a local variable.

Setting .text() instead of html to prevent possible XSS when carelessly copying translations.

Let me know if you wish jshint validation; I would do it :-) (e.g. lastx is not defined and will pollute the global scope)