Generate spaceless username

Replace whitespaces with underscores when generating usernames, to avoid usernames containing whitespaces. Cases where this can occur is for users with double names as first or last name, such as "Niklas Antti"...