Support usernames with @ in them (hence Google Apps support), also minor code and style cleanup