User class and tests