refactor to make it easier to hash passwords
simplified passwordStorage methods, added tests.