make a passwords table so that we have a history

this also fixes a few authentication bugs