Moved password salting into functions

Guh, I can't wait to be secure...