invalid checks to username, and isValidUsername updated to test for unde...

...fined. test added