[BISERVER-11758] - adding users to roles was using incorrect util for generating the tenant id, causing the cache to keep the old user credentials.  Also, removing users from roles were not getting purged from the cache.  cherry-picked from ce700ed.
[MOBILE-484] Pentaho Mobile is now presenting the user with BasicAuth rather than the mobile login page
Merge pull request #1644 from kurtwalker/BISERVER-11758-51

Biserver 11758 51
Merge pull request #1645 from mdamour1976/5.1

[MOBILE-484] Pentaho Mobile is now presenting the user with BasicAuth rather than the mobile login page
[BISERVER-11761] Added JavaScript string encoding for SESSION_NAME and HOME_FOLDER in webcontext