Added some unit tests for the user.
improved user contructor