Add IsValidUserName

This PR adds a new func IsValidUserName, which validates the user's name, passed in as a string.
Just following the pattern. Happy to take it out. @howbazaar ?