Move hash generation back into the UserValidationHash class

I don't really know why it was moved out of that class, but duplicate code makes things harder to maintain, and that code should have just stayed where it was... objections?