Add button to generate password.

Also add some UI logic to switch between input type=text and
type=password so that the user can easily copy out the generated
password.