Fix to allow email addresses as users names, Issue #163 #158

Added a regular expression to validate if the username is an email
address or not.  If the username is an email address then the username
will not be encoded/decoded.