Localization procedure fixes/checks  and other minor bugs

This code changes two things
* The locale selection mechanism.
* Checks to sanitize broken locale settings and to avoid them.

Fixes / benefits:
* With the previous (non `flask.ext.babel`-standard) mechanism to select locales:
    * The `flask` application didn't have a default fallback locale.
    * It was very difficult to have a per user based localization. Now it is trivial (the `flask` part)
    *  When changing the localization from the settings menu, the *update* message was issued in the previous localization.
    * The english language was repeated in the settings.
* If the notebook locale configuration was corrupted, the application hung and recovery procedure was a pain.
* Locale coruption configuration was very easy to attain. Consider the following scenarios:
    * Create a dummmy file or directory in the translation directory. Then select it from the settings menu.
    * Downgrade to a notebook version lacking for a certain localization present in the substituted version.

There are two different sanity checks. The change in `sagenb.misc.misc.get_languages` is a workarround due to the mix of the *model* and *view* sections in the code on the `sagenb.notebook` package.