Added class and test for password validation