lots of fixes, tested passphrase code path, and a bunch of other stuff