Update recovery data after changing password

Fixes stellar/ix#421.
You're right. I reorganized this code to be easier to read.