Fixed issue #2196 about caching user and roles to speed up the db.open(). Introduced 2 new global settings: SECURITY_MAX_CACHED_USERS and SECURITY_MAX_CACHED_ROLES.