Test that new usernames only contain alphanumeric characters, underscores and dashes

Also fixes the pattern for testing emails so it doesn't allow any spaces or unexpected characters.