refactor tests, fix performance bug in password hasher and improving form error style