Mostly Fixes#893
A couple methods cache callbacks, and will require a larger refactor to fully denodeify.
Specifically, our methods involving web3 requests to sign a tx, sign a message, and approve or cancel either of those.
I think we should postpone those until the TxManager refactor, since it will likely handle this response caching itself.
At least, the portion of it that we use.
Moved salting within the encryptor, so it does not need to be managed externally.
KeyringController now caches the password instead of a passwordDerivedKey, since it is ignorant of the salt.
Encryptor payload is now in a JSON format, so its portions are both base64 encoded *and* labeled appropriately. The format is `{ "data": "0x0", "iv": "0x0", "salt": "string" }`.
Fixes#843Fixes#859
Now old vaults are recognized as an "Initialized" MetaMask instance.
Upon logging in, when fetching the initial password-derived key, if there is no new-style vault, but there is an old style vault, it is migrated to the new format before proceeding through the usual unlocking steps.
SubmitPassword was not creating a new id-management
This is because I broke up the old "createIdmgmt" method to not perform as much conditional logic.
Now the pieces are reusable and do what they should do.
Fixed bug where the second new vault created in an IdStore would initially return the accounts from the original store.
Also fixed some tests that were incorrect.
eth-lightwallet was previously not salting vault passwords, potentially making it easier to crack them once obtained.
This branch incorporates the API changes to allow us to take advantage of the new salting logic.
This is still throwing deprecation warnings, but that's actually a bug in eth-lightwallet I wrote, [I've submitted a PR for that here](https://github.com/ConsenSys/eth-lightwallet/pull/116).
Fixes#555
Also added the hdPath that Christian had told me to our calls to the LightWallet, but this does not seem to have made us generate the same accounts as `testrpc` yet.
Added initial test just to verify we can recover the accounts we generate in this way.
Still need to add compliance test to make sure this interoperates with testrpc's new mnemonic flag.