Added password versioning support
Generator function now returns a password generator, generate function uses it
Fixed test after rebase