Clear cached engine when global engine changes

The keystone.common.sql.core.Base class cached the global database
engine when get_session() was called. When the global database engine
changed to a new instance, the cached copy was used in subsequent
calls to get_session(), leading to using the old engine and tests
failing to run by themselves.

This change makes it so that when the global database engine is
changed, Base will use the new engine rather than the invalid one.

Change-Id: I75aa3c230d9b4fd666ab8d478c9e9a27669905e8
Fixes: Bug #1179259
default token format/provider handling

The Keystone server would print a warning when both the token
format and provider were set to the default.

Also, the Keystone server would not start if the format was
commented out and the provider was set to the uuid.Provider.

Fixes: bug 1204314

Change-Id: Id7db33a1f27c4986af153efc73b22db8c6a8942e
Implement exception module i18n support

The doc string in exception.py of Keystone will be
returned with __doc__ method, but cannot realize the
internationalization.Change exception module to enable
i18n support.

Changes in the patch are:
1, useing class variable msg_fmt to replace class __doc__
2, modify wsgi.render_exception function using unicode
function to replace str function
3, modify/add UT test cases

Fixes: bug # 1179425

Change-Id: I75c1229c905a2625d2f6961d1a8dd3958eac51a5
Merge "Clear cached engine when global engine changes"
Merge "Implement exception module i18n support"
Merge "default token format/provider handling"