Fix password validation

Makes the validate password function actually work properly. Also makes the create user javascript in line with the function.