Make i18n work with caching.

Solves #1181. Depends on #1465. i18n now works with caching. Fortunately, the Django framework caches on a per-language level as well. To make the whole thing work smoothly, the installed language list has been transferred from a session variable to a global variable. Some bugs fixed along the way as well. Tested with both the development server and cherrypy.

Some possible bugs: Logging in as admin user on two browsers, and then setting the default language on one browser can cause the server's 'default_language' and the admin's default language to go out of sync. To solve this, clear the cache by visiting `/api/clear_all_caches`.

@bcipolli Please test and code review.