Improvements and cleanup to the password API and SPI
Second take