Only allow valid emails as usernames (#95)

Fix for issue #95.

Also prevent empty usernames.