Use Auth class instead of constants - will allow better masquerade function.  Escape username, to remove restriction on allowed characters - Simplify complex method - https://github.com/fisharebest/webtrees/commit/6b7ac6a816a08a6f23e7b5429da31f625a91926a